The requested content cannot be loaded. Please try again later.
',
closeBtn: '").html(e).find(a.selector):u(e)&&(e.data("fancybox-placeholder")||e.data("fancybox-placeholder", f('
').insertAfter(e).hide()), e=e.show().detach(), a.wrap.bind("onReset", function(){
f(this).find(e).length&&e.hide().replaceAll(e.data("fancybox-placeholder")).data("fancybox-placeholder", !1)
}));
break;
case "image":
e=a.tpl.image.replace(/\{href\}/g, g);
break;
case "swf":
e='
', h="", f.each(a.swf, function(a, b){
e +=' ';
h +=" " + a + '="' + b + '"'
}), e +='"
}
u(e)&&e.parent().is(a.inner)||a.inner.append(e);
b.trigger("beforeShow");
a.inner.css("overflow", "yes"===l ? "scroll":"no"===l ? "hidden":l);
b._setDimension();
b.reposition();
b.isOpen = !1;
b.coming=null;
b.bindEvents();
if(!b.isOpened) f(".fancybox-wrap").not(a.wrap).stop(!0).trigger("onReset").remove();
else if(d.prevMethod) b.transitions[d.prevMethod]();
b.transitions[b.isOpened ? a.nextMethod:a.openMethod]();
b._preloadImages()
}},
_setDimension: function(){
var a=b.getViewport(),
d=0,
e = !1,
c = !1,
e=b.wrap,
l=b.skin,
g=b.inner,
h=b.current,
c=h.width,
k=h.height,
n=h.minWidth,
v=h.minHeight,
p=h.maxWidth,
q=h.maxHeight,
t=h.scrolling,
r=h.scrollOutside ? h.scrollbarWidth:0,
y=h.margin,
z=m(y[1] + y[3]),
s=m(y[0] + y[2]),
w, A, u, D, B, G, C, E, I;
e.add(l).add(g).width("auto").height("auto").removeClass("fancybox-tmp");
y=m(l.outerWidth(!0) - l.width());
w=m(l.outerHeight(!0) - l.height());
A=z + y;
u=s + w;
D=F(c) ? (a.w - A) * m(c) / 100:c;
B=F(k) ? (a.h - u) * m(k) / 100:k;
if("iframe"===h.type){
if(I=h.content, h.autoHeight&&1===I.data("ready")) try {
I[0].contentWindow.document.location&&(g.width(D).height(9999), G=I.contents().find("body"), r&&G.css("overflow-x",
"hidden"), B=G.outerHeight(!0))
} catch (H){}}else if(h.autoWidth||h.autoHeight) g.addClass("fancybox-tmp"), h.autoWidth||g.width(D), h.autoHeight||g.height(B), h.autoWidth&&(D=g.width()), h.autoHeight&&(B=g.height()), g.removeClass("fancybox-tmp");
c=m(D);
k=m(B);
E=D / B;
n=m(F(n) ? m(n, "w") - A:n);
p=m(F(p) ? m(p, "w") - A:p);
v=m(F(v) ? m(v, "h") - u:v);
q=m(F(q) ? m(q, "h") - u:q);
G=p;
C=q;
h.fitToView&&(p=Math.min(a.w - A, p), q=Math.min(a.h - u, q));
A=a.w - z;
s=a.h - s;
h.aspectRatio ? (c > p&&(c=p, k=m(c / E)), k > q&&(k=q, c=m(k * E)), c < n&&(c=n, k=m(c /
E)), k < v&&(k=v, c=m(k * E))):(c=Math.max(n, Math.min(c, p)), h.autoHeight&&"iframe"!==h.type&&(g.width(c), k=g.height()), k=Math.max(v, Math.min(k, q)));
if(h.fitToView)
if(g.width(c).height(k), e.width(c + y), a=e.width(), z=e.height(), h.aspectRatio)
for (;
(a > A||z > s)&&c > n&&k > v&&!(19 < d++);) k=Math.max(v, Math.min(q, k - 10)), c=m(k * E), c < n&&(c=n, k=m(c / E)), c > p&&(c=p, k=m(c / E)), g.width(c).height(k), e.width(c + y), a=e.width(), z=e.height();
else c=Math.max(n, Math.min(c, c - (a - A))), k=Math.max(v, Math.min(k, k - (z - s)));
r&&"auto"===t&&k < B &&
c + y + r < A&&(c +=r);
g.width(c).height(k);
e.width(c + y);
a=e.width();
z=e.height();
e=(a > A||z > s)&&c > n&&k > v;
c=h.aspectRatio ? c < G&&k < C&&c < D&&k < B:(c < G||k < C)&&(c < D||k < B);
f.extend(h, {
dim: {
width: x(a),
height: x(z)
},
origWidth: D,
origHeight: B,
canShrink: e,
canExpand: c,
wPadding: y,
hPadding: w,
wrapSpace: z - l.outerHeight(!0),
skinSpace: l.height() - k
});
!I&&h.autoHeight&&k > v&&k < q&&!c&&g.height("auto")
},
_getPosition: function(a){
var d=b.current,
e=b.getViewport(),
c=d.margin,
f=b.wrap.width() + c[1] + c[3],
g=b.wrap.height() + c[0] + c[2],
c={
position: "absolute",
top: c[0],
left: c[3]
};
d.autoCenter&&d.fixed&&!a&&g <=e.h&&f <=e.w ? c.position="fixed":d.locked||(c.top +=e.y, c.left +=e.x);
c.top=x(Math.max(c.top, c.top + (e.h - g) * d.topRatio));
c.left=x(Math.max(c.left, c.left + (e.w - f) * d.leftRatio));
return c
},
_afterZoomIn: function(){
var a=b.current;
a&&((b.isOpen=b.isOpened = !0, b.wrap.css("overflow", "visible").addClass("fancybox-opened"), b.update(), (a.closeClick||a.nextClick&&1 < b.group.length)&&b.inner.css("cursor", "pointer").bind("click.fb", function(d){
f(d.target).is("a")||f(d.target).parent().is("a") ||
(d.preventDefault(), b[a.closeClick ? "close":"next"]())
}), a.closeBtn&&f(a.tpl.closeBtn).appendTo(b.skin).bind("click.fb", function(a){
a.preventDefault();
b.close()
}), a.arrows&&1 < b.group.length&&((a.loop||0 < a.index)&&f(a.tpl.prev).appendTo(b.outer).bind("click.fb", b.prev), (a.loop||a.index < b.group.length - 1)&&f(a.tpl.next).appendTo(b.outer).bind("click.fb", b.next)), b.trigger("afterShow"), a.loop||a.index!==a.group.length - 1) ? b.opts.autoPlay&&!b.player.isActive&&(b.opts.autoPlay = !1, b.play(!0)):b.play(!1))
},
_afterZoomOut: function(a){
a=a||b.current;
f(".fancybox-wrap").trigger("onReset").remove();
f.extend(b, {
group: {},
opts: {},
router: !1,
current: null,
isActive: !1,
isOpened: !1,
isOpen: !1,
isClosing: !1,
wrap: null,
skin: null,
outer: null,
inner: null
});
b.trigger("afterClose", a)
}});
b.transitions={
getOrigPosition: function(){
var a=b.current,
d=a.element,
e=a.orig,
c={},
f=50,
g=50,
h=a.hPadding,
k=a.wPadding,
n=b.getViewport();
!e&&a.isDom&&d.is(":visible")&&(e=d.find("img:first"), e.length||(e=d));
u(e) ? (c=e.offset(), e.is("img") &&
(f=e.outerWidth(), g=e.outerHeight())):(c.top=n.y + (n.h - g) * a.topRatio, c.left=n.x + (n.w - f) * a.leftRatio);
if("fixed"===b.wrap.css("position")||a.locked) c.top -=n.y, c.left -=n.x;
return c={
top: x(c.top - h * a.topRatio),
left: x(c.left - k * a.leftRatio),
width: x(f + k),
height: x(g + h)
}},
step: function(a, d){
var e, c, f=d.prop;
c=b.current;
var g=c.wrapSpace,
h=c.skinSpace;
if("width"===f||"height"===f) e=d.end===d.start ? 1:(a - d.start) / (d.end - d.start), b.isClosing&&(e=1 - e), c="width"===f ? c.wPadding:c.hPadding, c=a - c, b.skin[f](m("width"===f ? c:c - g * e)), b.inner[f](m("width"===f ? c:c - g * e - h * e))
},
zoomIn: function(){
var a=b.current,
d=a.pos,
e=a.openEffect,
c="elastic"===e,
l=f.extend({
opacity: 1
}, d);
delete l.position;
c ? (d=this.getOrigPosition(), a.openOpacity&&(d.opacity=0.1)):"fade"===e&&(d.opacity=0.1);
b.wrap.css(d).animate(l, {
duration: "none"===e ? 0:a.openSpeed,
easing: a.openEasing,
step: c ? this.step:null,
complete: b._afterZoomIn
})
},
zoomOut: function(){
var a=b.current,
d=a.closeEffect,
e="elastic"===d,
c={
opacity: 0.1
};
e&&(c=this.getOrigPosition(), a.closeOpacity &&
(c.opacity=0.1));
b.wrap.animate(c, {
duration: "none"===d ? 0:a.closeSpeed,
easing: a.closeEasing,
step: e ? this.step:null,
complete: b._afterZoomOut
})
},
changeIn: function(){
var a=b.current,
d=a.nextEffect,
e=a.pos,
c={
opacity: 1
},
f=b.direction,
g;
e.opacity=0.1;
"elastic"===d&&(g="down"===f||"up"===f ? "top":"left", "down"===f||"right"===f ? (e[g]=x(m(e[g]) - 200), c[g]="+=200px"):(e[g]=x(m(e[g]) + 200), c[g]="-=200px"));
"none"===d ? b._afterZoomIn():b.wrap.css(e).animate(c, {
duration: a.nextSpeed,
easing: a.nextEasing,
complete: b._afterZoomIn
})
},
changeOut: function(){
var a=b.previous,
d=a.prevEffect,
e={
opacity: 0.1
},
c=b.direction;
"elastic"===d&&(e["down"===c||"up"===c ? "top":"left"]=("up"===c||"left"===c ? "-":"+") + "=200px");
a.wrap.animate(e, {
duration: "none"===d ? 0:a.prevSpeed,
easing: a.prevEasing,
complete: function(){
f(this).trigger("onReset").remove()
}})
}};
b.helpers.overlay={
defaults: {
closeClick: !0,
speedOut: 200,
showEarly: !0,
css: {},
locked: !t,
fixed: !0
},
overlay: null,
fixed: !1,
el: f("html"),
create: function(a){
var d;
a=f.extend({}, this.defaults, a);
this.overlay &&
this.close();
d=b.coming ? b.coming.parent:a.parent;
this.overlay=f('
').appendTo(d&&d.lenth ? d:"body");
this.fixed = !1;
a.fixed&&b.defaults.fixed&&(this.overlay.addClass("fancybox-overlay-fixed"), this.fixed = !0)
},
open: function(a){
var d=this;
a=f.extend({}, this.defaults, a);
this.overlay ? this.overlay.unbind(".overlay").width("auto").height("auto"):this.create(a);
this.fixed||(q.bind("resize.overlay", f.proxy(this.update, this)), this.update());
a.closeClick&&this.overlay.bind("click.overlay",
function(a){
if(f(a.target).hasClass("fancybox-overlay")) return b.isActive ? b.close():d.close(), !1
});
this.overlay.css(a.css).show()
},
close: function(){
q.unbind("resize.overlay");
this.el.hasClass("fancybox-lock")&&(f(".fancybox-margin").removeClass("fancybox-margin"), this.el.removeClass("fancybox-lock"), q.scrollTop(this.scrollV).scrollLeft(this.scrollH));
f(".fancybox-overlay").remove().hide();
f.extend(this, {
overlay: null,
fixed: !1
})
},
update: function(){
var a="100%",
b;
this.overlay.width(a).height("100%");
J ? (b=Math.max(H.documentElement.offsetWidth, H.body.offsetWidth), p.width() > b&&(a=p.width())):p.width() > q.width()&&(a=p.width());
this.overlay.width(a).height(p.height())
},
onReady: function(a, b){
var e=this.overlay;
f(".fancybox-overlay").stop(!0, !0);
e||this.create(a);
a.locked&&this.fixed&&b.fixed&&(b.locked=this.overlay.append(b.wrap), b.fixed = !1);
!0===a.showEarly&&this.beforeShow.apply(this, arguments)
},
beforeShow: function(a, b){
b.locked&&!this.el.hasClass("fancybox-lock")&&(!1!==this.fixPosition&&f("*").filter(function(){
return "fixed"===f(this).css("position")&&!f(this).hasClass("fancybox-overlay")&&!f(this).hasClass("fancybox-wrap")
}).addClass("fancybox-margin"), this.el.addClass("fancybox-margin"), this.scrollV=q.scrollTop(), this.scrollH=q.scrollLeft(), this.el.addClass("fancybox-lock"), q.scrollTop(this.scrollV).scrollLeft(this.scrollH));
this.open(a)
},
onUpdate: function(){
this.fixed||this.update()
},
afterClose: function(a){
this.overlay&&!b.coming&&this.overlay.fadeOut(a.speedOut, f.proxy(this.close, this))
}};
b.helpers.title={
defaults: {
type: "float",
position: "bottom"
},
beforeShow: function(a){
var d=b.current,
e=d.title,
c=a.type;
f.isFunction(e)&&(e=e.call(d.element, d));
if(r(e)&&""!==f.trim(e)){
d=f('
' + e + "
");
switch (c){
case "inside":
c=b.skin;
break;
case "outside":
c=b.wrap;
break;
case "over":
c=b.inner;
break;
default:
c=b.skin, d.appendTo("body"), J&&d.width(d.width()), d.wrapInner('
'), b.current.margin[2] +=Math.abs(m(d.css("margin-bottom")))
}
d["top"===a.position ? "prependTo" :
"appendTo"](c)
}}
};
f.fn.fancybox=function(a){
var d, e=f(this),
c=this.selector||"",
l=function(g){
var h=f(this).blur(),
k=d,
l, m;
g.ctrlKey||g.altKey||g.shiftKey||g.metaKey||h.is(".fancybox-wrap")||(l=a.groupAttr||"data-fancybox-group", m=h.attr(l), m||(l="rel", m=h.get(0)[l]), m&&""!==m&&"nofollow"!==m&&(h=c.length ? f(c):e, h=h.filter("[" + l + '="' + m + '"]'), k=h.index(this)), a.index=k, !1!==b.open(h, a)&&g.preventDefault())
};
a=a||{};
d=a.index||0;
c&&!1!==a.live ? p.undelegate(c, "click.fb-start").delegate(c + ":not('.fancybox-item, .fancybox-nav')",
"click.fb-start", l):e.unbind("click.fb-start").bind("click.fb-start", l);
this.filter("[data-fancybox-start=1]").trigger("click");
return this
};
p.ready(function(){
var a, d;
f.scrollbarWidth===w&&(f.scrollbarWidth=function(){
var a=f('
').appendTo("body"),
b=a.children(),
b=b.innerWidth() - b.height(99).innerWidth();
a.remove();
return b
});
f.support.fixedPosition===w&&(f.support.fixedPosition=function(){
var a=f('
').appendTo("body"),
b=20===a[0].offsetTop||15===a[0].offsetTop;
a.remove();
return b
}());
f.extend(b.defaults, {
scrollbarWidth: f.scrollbarWidth(),
fixed: f.support.fixedPosition,
parent: f("body")
});
a=f(s).width();
K.addClass("fancybox-lock-test");
d=f(s).width();
K.removeClass("fancybox-lock-test");
f("").appendTo("head")
})
})(window, document, jQuery);
(function ($){
"use strict";
var F=$.fancybox,
format=function(url, rez, params){
params=params||'';
if($.type(params)==="object"){
params=$.param(params, true);
}
$.each(rez, function(key, value){
url=url.replace('$' + key, value||'');
});
if(params.length){
url +=(url.indexOf('?') > 0 ? '&':'?') + params;
}
return url;
};
F.helpers.media={
defaults:{
youtube:{
matcher:/(youtube\.com|youtu\.be|youtube-nocookie\.com)\/(watch\?v=|v\/|u\/|embed\/?)?(videoseries\?list=(.*)|[\w-]{11}|\?listType=(.*)&list=(.*)).*/i,
params:{
autoplay:1,
autohide:1,
fs:1,
rel:0,
hd:1,
wmode:'opaque',
enablejsapi:1
},
type:'iframe',
url:'//www.youtube.com/embed/$3'
},
vimeo:{
matcher:/(?:vimeo(?:pro)?.com)\/(?:[^\d]+)?(\d+)(?:.*)/,
params:{
autoplay:1,
hd:1,
show_title:1,
show_byline:1,
show_portrait:0,
fullscreen:1
},
type:'iframe',
url:'//player.vimeo.com/video/$1'
},
metacafe:{
matcher:/metacafe.com\/(?:watch|fplayer)\/([\w\-]{1,10})/,
params:{
autoPlay:'yes'
},
type:'swf',
url:function(rez, params, obj){
obj.swf.flashVars='playerVars=' + $.param(params, true);
return '//www.metacafe.com/fplayer/' + rez[1] + '/.swf';
}},
dailymotion:{
matcher:/dailymotion.com\/video\/(.*)\/?(.*)/,
params:{
additionalInfos:0,
autoStart:1
},
type:'swf',
url:'//www.dailymotion.com/swf/video/$1'
},
twitvid:{
matcher:/twitvid\.com\/([a-zA-Z0-9_\-\?\=]+)/i,
params:{
autoplay:0
},
type:'iframe',
url:'//www.twitvid.com/embed.php?guid=$1'
},
twitpic:{
matcher:/twitpic\.com\/(?!(?:place|photos|events)\/)([a-zA-Z0-9\?\=\-]+)/i,
type:'image',
url:'//twitpic.com/show/full/$1/'
},
instagram:{
matcher:/(instagr\.am|instagram\.com)\/p\/([a-zA-Z0-9_\-]+)\/?/i,
type:'image',
url:'//$1/p/$2/media/?size=l'
},
google_maps:{
matcher:/maps\.google\.([a-z]{2,3}(\.[a-z]{2})?)\/(\?ll=|maps\?)(.*)/i,
type:'iframe',
url:function(rez){
return '//maps.google.' + rez[1] + '/' + rez[3] + '' + rez[4] + '&output=' + (rez[4].indexOf('layer=c') > 0 ? 'svembed':'embed');
}}
},
beforeLoad:function(opts, obj){
var url=obj.href||'',
type=false,
what,
item,
rez,
params;
for (what in opts){
if(opts.hasOwnProperty(what)){
item=opts[ what ];
rez=url.match(item.matcher);
if(rez){
type=item.type;
params=$.extend(true, {}, item.params, obj[ what ]||($.isPlainObject(opts[ what ]) ? opts[ what ].params:null));
url=$.type(item.url)==="function" ? item.url.call(this, rez, params, obj):format(item.url, rez, params);
break;
}}
}
if(type){
obj.href=url;
obj.type=type;
obj.autoHeight=false;
}}
};}(jQuery));
;
(function ($, window, document, undefined){
var pluginName="MegaMenu",
defaults={
propertyName: "value"
};
var delayOut=400;
var menus=[];
function CustomMenu(element, options){
this.element=element;
this.options=$.extend({}, defaults, options);
this._defaults=defaults;
this._name=pluginName;
this.init();
}
CustomMenu.prototype={
isOpen: false,
timeout: null,
init: function (){
var that=this;
$(this).each(function(index, menu){
that.node=menu.element;
that.addListeners(menu.element);
var $menu=$(menu.element);
$menu.addClass("dropdownJavascript");
menus.push(menu.element);
$menu.find('ul > li').each(function(index, submenu){
if($(submenu).find('ul').length > 0){
$(submenu).addClass('with-menu');
}});
});
},
addListeners: function(menu){
var that=this;
$(menu).mouseover(function(e){
that.handleMouseOver.call(that, e);
}).mouseout(function(e){
that.handleMouseOut.call(that, e);
});
},
handleMouseOver: function (e){
var that=this;
this.clearTimeout();
var item=e.target||e.srcElement;
while (item.nodeName!='LI'&&item!=this.node){
item=item.parentNode;
}
if(item.nodeName=='LI'){
this.toOpen=item;
this.timeout=setTimeout(function(){
that.open.call(that);
}, this.options.delay);
}},
handleMouseOut: function (){
var that=this;
this.clearTimeout();
var _delayOut=this.options.delay;
if(delayOut){
_delayOut=delayOut;
}
this.timeout=setTimeout(function(){
that.close.call(that);
}, _delayOut);
},
clearTimeout: function (){
if(this.timeout){
clearTimeout(this.timeout);
this.timeout=null;
}},
open: function (){
var that=this;
this.isOpen=true;
var items=$(this.toOpen).parent().children('li');
$(items).each(function(index, item){
$(item).find("ul").each(function(index, submenu){
if(item!=that.toOpen){
$(item).removeClass("dropdownOpen");
that.close(item);
}else if(!$(item).hasClass('dropdownOpen')){
$(item).addClass("dropdownOpen");
var left=0;
var node=submenu;
while (node){
left +=Math.abs(node.offsetLeft);
node=node.offsetParent;
}
var right=left + submenu.offsetWidth;
var menuHeight=$(submenu).outerHeight();
var parentTop=$(submenu).offset().top - $(window).scrollTop();
var totalHeight=menuHeight + parentTop;
var windowHeight=window.innerHeight;
$(item).removeClass('dropdownRightToLeft');
if(left < 0) $(item).addClass('dropdownLeftToRight');
if(right > document.body.clientWidth){
$(item).addClass('dropdownRightToLeft');
}}
});
});
},
close: function (node){
if(!node){
this.isOpen=false;
node=this.node;
}
$(node).find('li').each(function(index, item){
$(item).removeClass('dropdownOpen');
});
}};
$.fn[pluginName]=function (options){
return this.each(function (){
if(!$.data(this, "plugin_" + pluginName)){
$.data(this, "plugin_" + pluginName,
new CustomMenu(this, options));
}});
};})(jQuery, window, document);
;(function(window, document, undefined){
var classes=[];
var tests=[];
var ModernizrProto={
_version: '3.3.1',
_config: {
'classPrefix': '',
'enableClasses': true,
'enableJSClass': true,
'usePrefixes': true
},
_q: [],
on: function(test, cb){
var self=this;
setTimeout(function(){
cb(self[test]);
}, 0);
},
addTest: function(name, fn, options){
tests.push({name: name, fn: fn, options: options});
},
addAsyncTest: function(fn){
tests.push({name: null, fn: fn});
}};
var Modernizr=function(){};
Modernizr.prototype=ModernizrProto;
Modernizr=new Modernizr();
var prefixes=(ModernizrProto._config.usePrefixes ? ' -webkit- -moz- -o- -ms- '.split(' '):['','']);
ModernizrProto._prefixes=prefixes;
function is(obj, type){
return typeof obj===type;
}
;
function testRunner(){
var featureNames;
var feature;
var aliasIdx;
var result;
var nameIdx;
var featureName;
var featureNameSplit;
for (var featureIdx in tests){
if(tests.hasOwnProperty(featureIdx)){
featureNames=[];
feature=tests[featureIdx];
if(feature.name){
featureNames.push(feature.name.toLowerCase());
if(feature.options&&feature.options.aliases&&feature.options.aliases.length){
for (aliasIdx=0; aliasIdx < feature.options.aliases.length; aliasIdx++){
featureNames.push(feature.options.aliases[aliasIdx].toLowerCase());
}}
}
result=is(feature.fn, 'function') ? feature.fn():feature.fn;
for (nameIdx=0; nameIdx < featureNames.length; nameIdx++){
featureName=featureNames[nameIdx];
featureNameSplit=featureName.split('.');
if(featureNameSplit.length===1){
Modernizr[featureNameSplit[0]]=result;
}else{
if(Modernizr[featureNameSplit[0]]&&!(Modernizr[featureNameSplit[0]] instanceof Boolean)){
Modernizr[featureNameSplit[0]]=new Boolean(Modernizr[featureNameSplit[0]]);
}
Modernizr[featureNameSplit[0]][featureNameSplit[1]]=result;
}
classes.push((result ? '':'no-') + featureNameSplit.join('-'));
}}
}}
;
var docElement=document.documentElement;
var isSVG=docElement.nodeName.toLowerCase()==='svg';
function setClasses(classes){
var className=docElement.className;
var classPrefix=Modernizr._config.classPrefix||'';
if(isSVG){
className=className.baseVal;
}
if(Modernizr._config.enableJSClass){
var reJS=new RegExp('(^|\\s)' + classPrefix + 'no-js(\\s|$)');
className=className.replace(reJS, '$1' + classPrefix + 'js$2');
}
if(Modernizr._config.enableClasses){
className +=' ' + classPrefix + classes.join(' ' + classPrefix);
isSVG ? docElement.className.baseVal=className:docElement.className=className;
}}
;
var html5;
if(!isSVG){
;(function(window, document){
var version='3.7.3';
var options=window.html5||{};
var reSkip=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i;
var saveClones=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i;
var supportsHtml5Styles;
var expando='_html5shiv';
var expanID=0;
var expandoData={};
var supportsUnknownElements;
(function(){
try {
var a=document.createElement('a');
a.innerHTML='
';
supportsHtml5Styles=('hidden' in a);
supportsUnknownElements=a.childNodes.length==1||(function(){
(document.createElement)('a');
var frag=document.createDocumentFragment();
return (
typeof frag.cloneNode=='undefined' ||
typeof frag.createDocumentFragment=='undefined' ||
typeof frag.createElement=='undefined'
);
}());
} catch(e){
supportsHtml5Styles=true;
supportsUnknownElements=true;
}}());
function addStyleSheet(ownerDocument, cssText){
var p=ownerDocument.createElement('p'),
parent=ownerDocument.getElementsByTagName('head')[0]||ownerDocument.documentElement;
p.innerHTML='x';
return parent.insertBefore(p.lastChild, parent.firstChild);
}
function getElements(){
var elements=html5.elements;
return typeof elements=='string' ? elements.split(' '):elements;
}
function addElements(newElements, ownerDocument){
var elements=html5.elements;
if(typeof elements!='string'){
elements=elements.join(' ');
}
if(typeof newElements!='string'){
newElements=newElements.join(' ');
}
html5.elements=elements +' '+ newElements;
shivDocument(ownerDocument);
}
function getExpandoData(ownerDocument){
var data=expandoData[ownerDocument[expando]];
if(!data){
data={};
expanID++;
ownerDocument[expando]=expanID;
expandoData[expanID]=data;
}
return data;
}
function createElement(nodeName, ownerDocument, data){
if(!ownerDocument){
ownerDocument=document;
}
if(supportsUnknownElements){
return ownerDocument.createElement(nodeName);
}
if(!data){
data=getExpandoData(ownerDocument);
}
var node;
if(data.cache[nodeName]){
node=data.cache[nodeName].cloneNode();
}else if(saveClones.test(nodeName)){
node=(data.cache[nodeName]=data.createElem(nodeName)).cloneNode();
}else{
node=data.createElem(nodeName);
}
return node.canHaveChildren&&!reSkip.test(nodeName)&&!node.tagUrn ? data.frag.appendChild(node):node;
}
function createDocumentFragment(ownerDocument, data){
if(!ownerDocument){
ownerDocument=document;
}
if(supportsUnknownElements){
return ownerDocument.createDocumentFragment();
}
data=data||getExpandoData(ownerDocument);
var clone=data.frag.cloneNode(),
i=0,
elems=getElements(),
l=elems.length;
for(;i
scrollFrom){
if($el.data("sens")=="back"){
currentTime=1;
$el.data("sens", "go");
}else{
currentTime++;
}}
if(scrollCurrent0&¤tTime<=totalTime){
var from=defaultProp;
if($el.data("sens")=="back"){
from=to;
to=-to;
easing=easingReturn;
totalTime=totalTimeReturn;
}
val=$.easing[easing](null, currentTime, from, to, totalTime);
}
val=Math.ceil(val * this.round) / this.round;
if(val==prev&&next==to) val=to;
if(!properties[prop]) properties[prop]=0;
properties[prop] +=val;
if(prev!=properties[prop]){
$el.data("_" + prop, properties[prop]);
applyProperties=true;
}}, this));
}
if(applyProperties){
if(properties["z"]!=undefined){
var perspective=data["perspective"];
if(perspective==undefined) perspective=800;
var $parent=$el.parent();
if(!$parent.data("style")) $parent.data("style", $parent.attr("style")||"");
$parent.attr("style", "perspective:" + perspective + "px; -webkit-perspective:" + perspective + "px; "+ $parent.data("style"));
}
if(properties["scaleX"]==undefined) properties["scaleX"]=1;
if(properties["scaleY"]==undefined) properties["scaleY"]=1;
if(properties["scaleZ"]==undefined) properties["scaleZ"]=1;
if(properties["scale"]!=undefined){
properties["scaleX"] *=properties["scale"];
properties["scaleY"] *=properties["scale"];
properties["scaleZ"] *=properties["scale"];
}
var translate3d="translate3d(" + (properties["x"] ? properties["x"]:0) + "px, " + (properties["y"] ? properties["y"]:0) + "px, " + (properties["z"] ? properties["z"]:0) + "px)";
var rotate3d="rotateX(" + (properties["rotateX"] ? properties["rotateX"]:0) + "deg) rotateY(" + (properties["rotateY"] ? properties["rotateY"]:0) + "deg) rotateZ(" + (properties["rotateZ"] ? properties["rotateZ"]:0) + "deg)";
var scale3d="scaleX(" + properties["scaleX"] + ") scaleY(" + properties["scaleY"] + ") scaleZ(" + properties["scaleZ"] + ")";
var cssTransform=translate3d + " " + rotate3d + " " + scale3d + ";";
this._log(cssTransform);
$el.attr("style", "transform:" + cssTransform + " -webkit-transform:" + cssTransform + " " + style);
}}, this));
if(window.requestAnimationFrame){
window.requestAnimationFrame($.proxy(this._onScroll, this, false));
}else{
this._requestAnimationFrame($.proxy(this._onScroll, this, false));
}}
};
;
(function($, window, undefined){
'use strict';
var Modernizr=window.Modernizr,
$body=$('body');
$.DLMenu=function(options, element){
this.$el=$(element);
this._init(options);
};
$.DLMenu.defaults={
animationClasses: {
classin: 'mk-vm-animate-in-' + mk_vertical_header_anim,
classout: 'mk-vm-animate-out-' + mk_vertical_header_anim
},
onLevelClick: function(el, name){
return false;
},
onLinkClick: function(el, ev){
return false;
}};
$.DLMenu.prototype={
_init: function(options){
this.options=$.extend(true, {}, $.DLMenu.defaults, options);
this._config();
var animEndEventNames={
'WebkitAnimation': 'webkitAnimationEnd',
'OAnimation': 'oAnimationEnd',
'msAnimation': 'MSAnimationEnd',
'animation': 'animationend'
},
transEndEventNames={
'WebkitTransition': 'webkitTransitionEnd',
'MozTransition': 'transitionend',
'OTransition': 'oTransitionEnd',
'msTransition': 'MSTransitionEnd',
'transition': 'transitionend'
};
this.animEndEventName=animEndEventNames[Modernizr.prefixed('animation')] + '.dlmenu';
this.transEndEventName=transEndEventNames[Modernizr.prefixed('transition')] + '.dlmenu';
this.animEndEventNameUnsufixed=animEndEventNames[Modernizr.prefixed('animation')];
this.transEndEventNameUnsufixed=transEndEventNames[Modernizr.prefixed('transition')];
this.supportAnimations=Modernizr.cssanimations;
this.supportTransitions=Modernizr.csstransitions;
this._initEvents();
},
_config: function(){
this.open=false;
this.$trigger=this.$el.children('.mk-vm-trigger');
this.$menu=this.$el.children('ul.mk-vm-menu');
this.$menuitems=this.$menu.find('li:not(.mk-vm-back)');
this.$back=this.$menu.find('li.mk-vm-back');
},
_initEvents: function(){
var self=this;
$('.mk-vm-menuwrapper a').on('transitionend', function(event){
event.stopPropagation();
});
this.$menuitems.on('click.dlmenu', 'a', function(event){
var $item=$(event.delegateTarget),
$submenu=$(event.currentTarget).siblings('ul.sub-menu');
if($submenu.length > 0){
var $flyin=$submenu.clone().css('opacity', 0).insertAfter(self.$menu);
var onAnimationEndFn=function(){
var $parent=$item.parents('.mk-vm-subviewopen:first');
self.$menu.off(self.animEndEventName).removeClass(self.options.animationClasses.classout).addClass('mk-vm-subview');
$item.addClass('mk-vm-subviewopen')
$parent.removeClass('mk-vm-subviewopen').addClass('mk-vm-subview');
$flyin.remove();
var $txt=$item.find('.meni-item-text');
$txt.css('opacity', 0.99);
setTimeout(function(){ $txt.css('opacity', 1) }, 0);
};
setTimeout(function(){
$flyin.addClass(self.options.animationClasses.classin);
self.$menu.addClass(self.options.animationClasses.classout);
if(self.supportAnimations){
self.$menu.on(self.animEndEventName, onAnimationEndFn);
}else{
onAnimationEndFn.call();
}
self.options.onLevelClick($item, $item.children('a:first').text());
});
return false;
}else{
self.options.onLinkClick($item, event);
}});
this.$back.on('click.dlmenu', function(event){
var $this=$(this),
$submenu=$this.parents('ul.sub-menu:first'),
$item=$submenu.parent(),
$flyin=$submenu.clone().insertAfter(self.$menu);
var onAnimationEndFn=function(){
self.$menu.off(self.animEndEventName).removeClass(self.options.animationClasses.classin);
$flyin.remove();
};
setTimeout(function(){
$flyin.addClass(self.options.animationClasses.classout);
self.$menu.addClass(self.options.animationClasses.classin);
if(self.supportAnimations){
self.$menu.on(self.animEndEventName, onAnimationEndFn);
}else{
onAnimationEndFn.call();
}
$item.removeClass('mk-vm-subviewopen');
var $subview=$this.parents('.mk-vm-subview:first');
if($subview.is('li')){
$subview.addClass('mk-vm-subviewopen');
}
$subview.removeClass('mk-vm-subview');
});
return false;
});
},
closeMenu: function(){
if(this.open){
this._closeMenu();
}},
_closeMenu: function(){
var self=this,
onTransitionEndFn=function(){
self.$menu.off(self.transEndEventName);
self._resetMenu();
};
this.$menu.removeClass('mk-vm-menuopen');
this.$menu.addClass('mk-vm-menu-toggle');
this.$trigger.removeClass('mk-vm-active');
if(this.supportTransitions){
this.$menu.on(this.transEndEventName, onTransitionEndFn);
}else{
onTransitionEndFn.call();
}
this.open=false;
},
openMenu: function(){
if(!this.open){
this._openMenu();
}},
_openMenu: function(){
var self=this;
$body.off('click').on('click.dlmenu', function(){
self._closeMenu();
});
this.$menu.addClass('mk-vm-menuopen mk-vm-menu-toggle').on(this.transEndEventName, function(){
$(this).removeClass('mk-vm-menu-toggle');
});
this.$trigger.addClass('mk-vm-active');
this.open=true;
},
_resetMenu: function(){
this.$menu.removeClass('mk-vm-subview');
this.$menuitems.removeClass('mk-vm-subview mk-vm-subviewopen');
}};
var logError=function(message){
if(window.console){
window.console.error(message);
}};
$.fn.dlmenu=function(options){
if(typeof options==='string'){
var args=Array.prototype.slice.call(arguments, 1);
this.each(function(){
var instance=$.data(this, 'dlmenu');
if(!instance){
logError("cannot call methods on dlmenu prior to initialization; " +
"attempted to call method '" + options + "'");
return;
}
if(!$.isFunction(instance[options])||options.charAt(0)==="_"){
logError("no such method '" + options + "' for dlmenu instance");
return;
}
instance[options].apply(instance, args);
});
}else{
this.each(function(){
var instance=$.data(this, 'dlmenu');
if(instance){
instance._init();
}else{
instance=$.data(this, 'dlmenu', new $.DLMenu(options, this));
}});
}
return this;
};})(jQuery, window);
(function($){
'use strict';
$('.mk-main-navigation .menu-item-has-children').children('a').attr('aria-haspopup', 'true');
$('.animated-column-item').attr('aria-haspopup', 'true');
})(jQuery);
(function($){
'use strict';
var Accordion=function(el){
var that=this,
$el=$(el),
initial=$el.data('initialindex'),
timeout;
this.$el=$el;
this.$single=$('.' + this.dom.single, $el);
this.isExpendable=($el.data('style')==='toggle-action');
this.bindClicks();
$(window).on('load', function(){
if(initial!==-1) that.show(that.$single.eq(initial))
});
$(window).on('resize', function(){
clearTimeout(timeout);
timeout=setTimeout(that.bindClicks.bind(that), 500);
});
}
Accordion.prototype.dom={
single:'mk-accordion-single',
tab:'mk-accordion-tab',
pane:'mk-accordion-pane',
current:'current',
mobileToggle:'mobile-false',
mobileBreakPoint:767
}
Accordion.prototype.bindClicks=function(){
this.$single.off('click', '.' + this.dom.tab);
if(!(window.matchMedia('(max-width: ' + this.dom.mobileBreakPoint +'px)').matches
&& this.$el.hasClass(this.dom.mobileToggle))){
this.$single.on('click', '.' + this.dom.tab, this.handleEvent.bind(this));
var $current=$('.' + this.dom.current, this.$el);
if($('.' + this.dom.pane, $current).css('display')==='none') this.show($current);
}}
Accordion.prototype.handleEvent=function(e){
e.preventDefault();
e.stopPropagation();
var $single=$(e.delegateTarget);
if(!$single.hasClass(this.dom.current)){
this.show($single);
}else{
if(this.isExpendable) this.hide($single);
}}
Accordion.prototype.hide=function($single){
$single.removeClass(this.dom.current);
$('.' + this.dom.pane, $single).slideUp();
}
Accordion.prototype.show=function($single){
if(!this.isExpendable){
var that=this;
this.hide($('.' + this.dom.current, that.$el));
}
$single.addClass(this.dom.current);
$('.' + this.dom.pane, $single).slideDown();
}
function init(){
$('.mk-accordion').each(function(){
new Accordion(this);
});
}
init();
$(window).on('vc_reload', init);
})(jQuery);
(function($){
'use strict';
var SkillDiagram=function(el){
this.el=el;
}
SkillDiagram.prototype={
init:function(){
this.cacheElements();
this.createDiagram();
this.$skills.each(this.createSkill.bind(this));
},
cacheElements:function(){
this.$el=$(this.el);
this.$skills=this.$el.find('.mk-meter-arch');
this.config=this.$el.data();
this.config.radius=this.config.dimension / 2;
},
random:function(l, u){
return Math.floor(( Math.random() *(u - l + 1)) + l);
},
createDiagram:function(){
var self=this;
$(this.el).find('svg').remove();
this.diagram=Raphael(this.el, this.config.dimension, this.config.dimension);
this.diagram.setViewBox(0,0,this.config.dimension,this.config.dimension,true);
this.diagram.setSize('90%', '90%');
this.diagram.circle(this.config.radius, this.config.radius, 80).attr({
stroke: 'none',
fill: this.config.circleColor
});
this.title=this.diagram.text(this.config.radius, this.config.radius, this.config.defaultText).attr({
font: "22px helvetica",
fill: this.config.defaultTextColor
}).toFront();
this.diagram.customAttributes.arc=function(value, color, rad){
var v=3.6 * value,
alpha=v==360 ? 359.99:v,
r=self.random(91, 240),
a=(r - alpha) * Math.PI/180,
b=r * Math.PI/180,
sx=self.config.radius + rad * Math.cos(b),
sy=self.config.radius - rad * Math.sin(b),
x=self.config.radius + rad * Math.cos(a),
y=self.config.radius - rad * Math.sin(a),
path=[['M', sx, sy], ['A', rad, rad, 0, +(alpha > 180), 1, x, y]];
return {
path: path,
stroke: color
}}
},
createSkill:function(id, el){
var self=this,
$this=$(el),
config=$this.data(),
radMin=72,
radVal=27,
newRad=radMin +(radVal * (id + 1));
var $path=this.diagram.path().attr({
'stroke-width': 28,
arc: [config.percent, config.color, newRad]
});
$path.mouseover(function(){
self.showSkill(this, config.name, config.percent);
}).mouseout(function(){
self.hideSkill(this)
});
},
showSkill:function(self, name, percent){
var $this=self,
time=250;
if(Raphael.type!='VML') $this.toFront();
$this.animate({
'stroke-width': 50,
'opacity': 0.9,
}, 800, 'elastic');
this.title.stop()
.animate({ opacity: 0 }, time, '>', function(){
this.attr({ text: name + '\n' + percent + '%' }).animate({ opacity: 1 }, time, '<');
}).toFront();
},
hideSkill:function(self){
var $this=self,
self=this,
time=250;
$this.stop().animate({
'stroke-width': 28,
opacity: 1
}, time * 4, 'elastic');
self.title.stop()
.animate({ opacity: 0 }, time, '>', function(){
self.title.attr({ text: self.config.defaultText })
.animate({ opacity: 1 }, time, '<');
});
}}
var init=function init(){
if(typeof Raphael==='undefined') return;
$('.mk-skill-diagram').each(function(){
var diagram=new SkillDiagram(this);
diagram.init();
});
}
init();
$(window).on('vc_reload', init);
})(jQuery);
(function($){
'use strict';
$('[data-js="tab-delegation"]').each(tabDelegation);
function tabDelegation(){
var $this=$(this),
data=$this.data();
if(data.tab) $this.on('click', 'a', openInTab);
}
function openInTab(e){
e.preventDefault();
var $this=$(this),
url=$this.attr('href');
window.open(url, '_blank');
}})(jQuery);
(function($){
'use strict';
var init=function init(){
var Toggle=function(el){
var that=this,
$el=$(el);
this.$el=$el;
$el.toggle(that.open.bind(that), that.close.bind(that));
};
Toggle.prototype.dom={
pane:'mk-toggle-pane',
active:'active-toggle'
};
Toggle.prototype.open=function(){
var $this=this.$el;
$this.addClass(this.dom.active);
$this.siblings('.' + this.dom.pane).slideDown(200);
};
Toggle.prototype.close=function(){
var $this=this.$el;
$this.removeClass(this.dom.active);
$this.siblings('.' + this.dom.pane).slideUp(200);
};
var $toggle=$('.mk-toggle-title');
if(!$toggle.length) return;
$toggle.each(function(){
new Toggle(this);
});
}
$(window).on('load vc_reload', init);
})(jQuery);
window.ajaxInit=function(){
mk_lightbox_init();
mk_click_events();
mk_social_share_global();
mk_gallery();
loop_audio_init();
};
window.ajaxDelayedInit=function(){
mk_flexslider_init();
};
$(document).ready(function(){
mk_lightbox_init();
mk_login_form();
mk_backgrounds_parallax();
mk_flexslider_init();
mk_event_countdown();
mk_skill_meter();
mk_milestone();
mk_ajax_search();
mk_hover_events();
mk_portfolio_ajax();
product_loop_add_cart();
mk_portfolio_widget();
mk_contact_form();
mk_blog_carousel();
mk_header_searchform();
mk_click_events();
mk_text_typer();
mk_tab_slider_func();
$(window).on('load', function(){
mk_unfold_footer();
mk_tabs();
mk_accordion_toggles_tooltip();
mk_gallery();
mk_theatre_responsive_calculator();
mk_tabs_responsive();
mk_start_tour_resize();
mk_header_social_resize();
mk_page_section_social_video_bg();
loop_audio_init();
mk_one_page_scroller();
mkPositionSidebar();
setTimeout(function(){
mk_mobile_tablet_responsive_calculator();
}, 300);
console.log("ready for rock");
});
var onDebouncedResize=function(){
mk_theatre_responsive_calculator();
mk_mobile_tablet_responsive_calculator();
mk_tabs_responsive();
mk_accordion_toggles_tooltip();
mk_start_tour_resize();
mk_header_social_resize();
setTimeout(function(){
mk_unfold_footer();
}, 300);
};
var debounceResize=null;
$(window).on("resize", function(){
if(debounceResize!==null){ clearTimeout(debounceResize); }
debounceResize=setTimeout(onDebouncedResize, 300);
});
var onDebouncedScroll=function(){
mk_skill_meter();
mk_milestone();
};
var debounceScroll=null;
$(window).on("scroll", function(){
if(debounceScroll!==null){ clearTimeout(debounceScroll); }
debounceScroll=setTimeout(onDebouncedScroll, 100);
});
if(MK.utils.isMobile()){
$('body').addClass('no-transform');
}});
$(window).on("vc_reload",function (){
mk_flexslider_init();
loop_audio_init();
mk_tab_slider_func();
mk_event_countdown();
videoLoadState();
mk_page_section_social_video_bg();
mk_hover_events();
setTimeout(function(){
mkPositionSidebar();
}, 200);
});
$(document).on('click', '.vc_control-btn-delete', function(){
$(window).trigger('vc_reload');
});
$(document).on('sortupdate', '.ui-sortable', function(){
$(window).trigger('vc_reload');
});
function mk_text_typer(){
"use strict";
$('[data-typer-targets]').each(function(){
var that=this;
MK.core.loadDependencies([ MK.core.path.plugins + 'jquery.typed.js' ], function(){
var $this=$(that),
$first_string=[$this.text()],
$rest_strings=$this.attr('data-typer-targets').split(','),
$strings=$first_string.concat($rest_strings);
$this.text('');
$this.typed({
strings: $strings,
typeSpeed: 30,
backDelay: 1200,
loop: true,
loopCount: false,
});
});
});
}
function mk_tab_slider_func(){
"use strict";
$('.mk-tab-slider').each(function(){
var that=this;
MK.core.loadDependencies([ MK.core.path.plugins + 'jquery.swiper.js' ], function(){
var $this=$(that),
id=$this.data('id'),
$autoplayTime=$this.data('autoplay'),
$content=$('.mk-slider-content');
var mk_tab_slider=$this.swiper({
wrapperClass: 'mk-tab-slider-wrapper',
slideClass: 'mk-tab-slider-item',
calculateHeight: true,
speed: 500,
autoplay: isTest ? false:$autoplayTime,
onSlideChangeStart: function(){
$('.mk-tab-slider-nav[data-id="' + id + '"]').find(".active").removeClass('active')
$('.mk-tab-slider-nav[data-id="' + id + '"]').find("a").eq(mk_tab_slider.activeIndex).addClass('active')
}});
function repaintFirefox(){
$content.css('display','block');
setTimeout(function(){
mk_tab_slider.reInit();
$content.css('display','table');
},100);
}
$('.mk-tab-slider-nav[data-id="' + id + '"]').find("a").first().addClass('active');
$('.mk-tab-slider-nav[data-id="' + id + '"]').find("a").on('touchstart mousedown', function(e){
e.preventDefault()
$('.mk-tab-slider-nav[data-id="' + id + '"]').find(".active").removeClass('active')
$(this).addClass('active')
mk_tab_slider.swipeTo($(this).index())
});
$('.mk-tab-slider-nav[data-id="' + id + '"]').find("a").click(function(e){
e.preventDefault();
});
repaintFirefox();
$(window).on('resize', repaintFirefox);
});
});
}
function mk_one_page_scroller(){
"use strict";
$('.mk-edge-one-pager').each(function(){
var self=this;
MK.core.loadDependencies([ MK.core.path.plugins + 'jquery.fullpage.js' ], function(){
var $this=$(self),
anchorArr=[];
$this.find('.section').each(function(){
anchorArr.push($(this).attr('data-title'));
});
var scrollable=true;
$this.find('.section').each(function(){
var $section=$(this),
$content=$section.find('.edge-slide-content'),
sectionHeight=$section.height(),
contentHeight=$content.innerHeight();
if((contentHeight + 30) > $(window).height()){
scrollable=false;
}});
if(!scrollable){
$this.find('.section').each(function(){
var $section=$(this);
$section.addClass('active').css({
'padding-bottom': '50px'
});
});
}
if(scrollable){
$this.fullpage({
verticalCentered: false,
resize: true,
slidesColor: ['#ccc', '#fff'],
anchors: anchorArr,
scrollingSpeed: 600,
easing: 'easeInQuart',
menu: false,
navigation: true,
navigationPosition: 'right',
navigationTooltips: false,
slidesNavigation: true,
slidesNavPosition: 'bottom',
loopBottom: false,
loopTop: false,
loopHorizontal: true,
autoScrolling: true,
scrollOverflow: false,
css3: true,
paddingTop: 0,
paddingBottom: 0,
normalScrollElements: '.mk-header, .mk-responsive-wrap',
normalScrollElementTouchThreshold: 5,
keyboardScrolling: true,
touchSensitivity: 15,
continuousVertical: false,
animateAnchor: true,
onLeave: function(index, nextIndex, direction){
var currentSkin=$this.find('.one-pager-slide').eq(nextIndex - 1).attr('data-header-skin');
MK.utils.eventManager.publish('firstElSkinChange', currentSkin);
$('#fullPage-nav').removeClass('light-skin dark-skin').addClass(currentSkin + '-skin');
},
afterRender: function(){
var $nav=$('#fullPage-nav');
setTimeout(function(){
var currentSkin=$this.find('.one-pager-slide').eq(0).attr('data-header-skin');
MK.utils.eventManager.publish('firstElSkinChange', currentSkin);
if($nav.length) $nav.removeClass('light-skin dark-skin').addClass(currentSkin + '-skin');
}, 300);
var $slide=$this.find('.section'),
headerHeight=MK.val.offsetHeaderHeight(0),
windowHeight=$(window).height();
$slide.height(windowHeight - headerHeight);
if($nav.length){
$nav.css({
'top': 'calc(50% + ' + (headerHeight/2) + 'px)',
'marginTop': 0
});
var style=$this.attr('data-pagination');
$nav.addClass('pagination-' + style);
}
setTimeout(mk_one_pager_resposnive, 1000);
},
afterResize: function(){
var $slide=$this.find('.section'),
headerHeight=MK.val.offsetHeaderHeight(0),
windowHeight=$(window).height();
$slide.height(windowHeight - headerHeight);
$('#fullPage-nav').css({
'top': 'calc(50% + ' + (headerHeight/2) + 'px)',
'marginTop': 0
});
setTimeout(mk_one_pager_resposnive, 1000);
console.log('Reposition pager content.');
},
});
}
function swipeTo(href, e){
href='_' + href;
if(!~href.indexOf('#')) return;
var section=href.split('#')[1];
if(~anchorArr.indexOf(section)){
if(typeof e!=='undefined') e.preventDefault();
if(scrollable) $.fn.fullpage.moveTo(section);
else MK.utils.scrollToAnchor('[data-title="'+section+'"]');
}}
var loc=window.location;
if(loc.hash) swipeTo(loc.hash);
$(document).on('click', 'a', function(e){
var $link=$(e.currentTarget);
swipeTo($link.attr('href'), e);
});
});
});
}
function mk_one_pager_resposnive(){
"use strict";
$('.mk-edge-one-pager').each(function(){
var $pager=$(this),
headerHeight=MK.val.offsetHeaderHeight(0),
windowHeight=$(window).height() - headerHeight;
$pager.find('.one-pager-slide').each(function(){
var $slide=$(this),
$content=$slide.find('.edge-slide-content');
if($slide.hasClass('left_center')||$slide.hasClass('center_center')||$slide.hasClass('right_center')){
var contentHeight=$content.height(),
distanceFromTop=(windowHeight - contentHeight) / 2;
distanceFromTop=(distanceFromTop < 50) ? 50 + headerHeight:distanceFromTop;
$content.css('marginTop', distanceFromTop);
}
if($slide.hasClass('left_bottom')||$slide.hasClass('center_bottom')||$slide.hasClass('right_bottom')){
var distanceFromTop=windowHeight - $content.height() - 90;
$content.css('marginTop', (distanceFromTop));
}});
var $row=$pager.parents('.vc_row.vc_row-fluid.mk-fullwidth-true');
if($row.length > 0){
var $wrapper=$('.mk-main-wrapper-holder');
var $grid=$row.children('.mk-grid');
var rowWidth=$row.width();
var wrapperWidth=$wrapper.width();
if(rowWidth >=wrapperWidth||$grid.length > 0){
return;
}
var $content=$wrapper.find('.theme-content');
var oriPos=$content.position();
var oriPadLeft=$content.css('padding-left');
var oriLeft=parseInt(oriPos.left) + parseInt(oriPadLeft);
if(wrapperWidth <=0||oriLeft <=0){
return;
}
$row.css({
'width': wrapperWidth,
'left': oriLeft * -1,
});
}});
}
function mk_gallery(){
"use strict";
$('.mk-gallery .mk-gallery-item.hover-overlay_layer .item-holder').each(function(){
var itemHolder=$(this),
galleryDesc=itemHolder.find('.gallery-desc');
function updatePosition(){
var parentHeight=itemHolder.outerHeight(),
contentHeight=galleryDesc.innerHeight();
var paddingVal=(parentHeight - contentHeight) / 2;
galleryDesc.css({
'top': paddingVal,
});
}
updatePosition();
$(window).on('resize', function(){
setTimeout(function(){
updatePosition();
}, 1000);
});
});
if($(window).width() <=1024){
$('.mk-gallery .mk-gallery-item').on('click', function (e){
var clicks=$(this).data('clicks');
if(clicks){
$(this).toggleClass('hover-state');
}else{
$(this).toggleClass('hover-state');
}
$(this).data("clicks", !clicks);
});
}}
function mk_theatre_responsive_calculator(){
var $laptopContainer=$(".laptop-theatre-slider");
var $computerContainer=$(".desktop-theatre-slider");
$laptopContainer.each(function(){
var $this=$(this),
$window=$(window),
$windowWidth=$window.outerWidth(),
$windowHeight=$window.outerHeight(),
$width=$this.outerWidth(),
$height=$this.outerHeight(),
$paddingTop=38,
$paddingRight=143,
$paddingBottom=78,
$paddingLeft=143;
var $player=$this.find('.player-container');
if($windowWidth > $width){
$player.css({
'padding-left': parseInt(($width * $paddingLeft) / 1200),
'padding-right': parseInt(($width * $paddingRight) / 1200),
'padding-top': parseInt(($height * $paddingTop) / 690),
'padding-bottom': parseInt(($height * $paddingBottom) / 690),
});
}});
$computerContainer.each(function(){
var $this=$(this),
$window=$(window),
$windowWidth=$window.outerWidth(),
$windowHeight=$window.outerHeight(),
$width=$this.outerWidth(),
$height=$this.outerHeight(),
$paddingTop=60,
$paddingRight=52,
$paddingBottom=290,
$paddingLeft=49;
var $player=$this.find('.player-container');
if($windowWidth > $width){
$player.css({
'padding-left': parseInt(($width * $paddingLeft) / 1200),
'padding-right': parseInt(($width * $paddingRight) / 1200),
'padding-top': parseInt(($height * $paddingTop) / 969),
'padding-bottom': parseInt(($height * $paddingBottom) / 969),
});
}});
}
function mk_mobile_tablet_responsive_calculator(){
var $laptopSlideshow=$(".mk-laptop-slideshow-shortcode");
var $lcdSlideshow=$(".mk-lcd-slideshow");
if($.exists(".mk-laptop-slideshow-shortcode")){
$laptopSlideshow.each(function(){
var $this=$(this),
$window=$(window),
$windowWidth=$window.outerWidth(),
$windowHeight=$window.outerHeight(),
$width=$this.outerWidth(),
$height=$this.outerHeight(),
$paddingTop=28,
$paddingRight=102,
$paddingBottom=52,
$paddingLeft=102;
var $player=$this.find(".slideshow-container");
$player.css({
"padding-left": parseInt(($width * $paddingLeft) / 836),
"padding-right": parseInt(($width * $paddingRight) / 836),
"padding-top": parseInt(($height * $paddingTop) / 481),
"padding-bottom": parseInt(($height * $paddingBottom) / 481),
});
});
}
if($.exists(".mk-lcd-slideshow")){
$lcdSlideshow.each(function(){
var $this=$(this),
$window=$(window),
$windowWidth=$window.outerWidth(),
$windowHeight=$window.outerHeight(),
$width=$this.outerWidth(),
$height=$this.outerHeight(),
$paddingTop=35,
$paddingRight=39,
$paddingBottom=213,
$paddingLeft=36;
var $player=$this.find(".slideshow-container");
$player.css({
"padding-left": parseInt(($width * $paddingLeft) / 886),
"padding-right": parseInt(($width * $paddingRight) / 886),
"padding-top": parseInt(($height * $paddingTop) / 713),
"padding-bottom": parseInt(($height * $paddingBottom) / 713),
});
});
}}
function mk_start_tour_resize(){
$('.mk-header-start-tour').each(function(){
var $windowWidth=$(document).width(),
$this=$(this),
$linkWidth=$this.width() + 15,
$padding=($windowWidth - mk_responsive_nav_width) / 2;
function updateStartTour(){
if($windowWidth < mk_responsive_nav_width){
$this.removeClass('hidden');
$this.addClass('show');
}else{
if($padding < $linkWidth){
$this.removeClass('show');
$this.addClass('hidden');
}else{
$this.removeClass('hidden');
$this.addClass('show');
}}
}
setTimeout(function(){
updateStartTour();
}, 300);
});
}
function mk_header_social_resize(){
$('.mk-header-social.header-section').each(function(){
var $windowWidth=$(document).width(),
$this=$(this),
$linkWidth=$this.width() + 15,
$padding=($windowWidth - mk_responsive_nav_width) / 2;
function updateStartTour(){
if($windowWidth < mk_responsive_nav_width){
$this.removeClass('hidden');
$this.addClass('show');
}else{
if($padding < $linkWidth){
$this.removeClass('show');
$this.addClass('hidden');
}else{
$this.removeClass('hidden');
$this.addClass('show');
}}
}
setTimeout(function(){
updateStartTour();
}, 300);
});
}
function mk_page_section_social_video_bg(){
$(".mk-page-section.social-hosted").each(function(){
var $container=$(this),
$sound=$container.data('sound'),
$source=$container.data('source'),
player,
timer=1000;
if($('body').hasClass('.compose-mode')){
timer=2000;
}
if($source=='youtube'){
var youtube=$container.find('iframe')[0];
try {
player=new YT.Player(youtube, {
events: {
'onReady': function (){
player.playVideo();
if($sound==false){
player.mute();
}}
}});
} catch (e){
console.log(e);
}}
if($source=='vimeo'){
var vimeo=$container.find('iframe')[0];
player=$f(vimeo);
setTimeout(function(){
player.api('play');
if($sound===false){
player.api('setVolume', 0);
}}, timer);
}});
}
function videoLoadState(){
$('.mk-section-video video').each(function(){
var mkVideo=this;
mkVideo.play();
this.onload=fire();
function fire(){
setTimeout(function(){
$(mkVideo).animate({
'opacity': 1
}, 300);
}, 1000);
}});
}
videoLoadState();
(function($){
$(window).on('load vc_reload', initialize);
function initialize(){
var $gmap=$('.gmap_widget');
if($gmap.length&&typeof google!=='undefined') $gmap.each(run);
}
function run(){
var $mapHolder=$(this);
var myLatlng=new google.maps.LatLng($mapHolder.data('latitude'), $mapHolder.data('longitude'));
var mapOptions=$mapHolder.data('options');
mapOptions.mapTypeId=google.maps.MapTypeId.ROADMAP;
mapOptions.center=myLatlng;
var map=new google.maps.Map(this, mapOptions);
new google.maps.Marker({
position: myLatlng,
map: map
});
}}(jQuery));
(function($){
$(window).on('load', function(){
var $feeds=$('.mk-instagram-feeds');
if($feeds.length) $feeds.each(run);
});
function run(){
var options=$(this).data('options');
options.template=' ';
var feed=new Instafeed(options);
feed.run();
}}(jQuery));
(function($){
$(window).on('load', function(){
setTimeout(function(){
$('.chrome-flipbox-backface-fix').removeClass('chrome-flipbox-backface-fix');
}, 300);
});
}(jQuery));
(function($){
$(window).on('load', function(){
$('.vc_tta-tab a').on('click', function(){
setTimeout(function(){
$(window).trigger('resize');
}, 100);
});
});
}(jQuery));
(function($){
$(window).on('load', function(){
$('#mk-vm-menu .menu-item-has-children, #mk-vm-menu .mk-vm-back').on('mouseenter', function(){
var $header_inner=$(this).closest('.mk-header-inner'),
$header_inner_height=$header_inner.outerHeight(),
$header_bg=$header_inner.find('.mk-header-bg'),
total_height=0;
$header_bg.css('height', '100%');
setTimeout(function(){
$header_inner.children(':visible').each(function(){
total_height +=$(this).outerHeight(true);
});
total_height -=$header_bg.height();
if(total_height < $header_inner_height){
$header_bg.css('height', '100%');
}else{
$header_bg.css('height', total_height + 'px');
}}, 600);
});
});
}(jQuery));
(function($){
$(window).on('load', function(){
var $variations_form=$('.variations_form');
if($variations_form.length){
var $varitions_selects=$variations_form.find('.variations').find('.value').find('select');
$varitions_selects.on('change', function(){
var $all_img_container=$('.mk-product-image .mk-woocommerce-main-image');
if($all_img_container.length){
$($all_img_container).each(set_lightbox_href);
}});
$varitions_selects.trigger('change');
}});
function set_lightbox_href(){
var $product_img=$(this).find('img'),
$lightbox=$(this).find('.mk-lightbox');
setTimeout(function(){
var image_url=$product_img.attr('src'),
image_suffix=image_url.substr(image_url.lastIndexOf('.') - image_url.length),
image_url=image_url.slice(0 , image_url.lastIndexOf('-'));
$lightbox.attr('href', image_url + image_suffix);
}, 300);
}}(jQuery));
(function($){
if(MK.utils.isMobile()){
$('.mk-section-video video').remove();
}}(jQuery));
(function($){
$(window).on('load', function(){
$(document).on('yith-wcan-ajax-filtered yith_infs_added_elem yith-wcan-ajax-reset-filtered', function(){
setTimeout(function(){
MK.utils.eventManager.publish('ajaxLoaded');
MK.core.initAll(document);
}, 1000);
});
$(document).on('yith-wcan-ajax-filtered yith-wcan-ajax-reset-filtered', function(){
setTimeout(function(){
$('.woocommerce-ordering').on('change', 'select.orderby', function(){
$(this).closest('form').submit();
});
}, 1000);
});
});
}(jQuery));
!function(e){var a=window.location,n=a.hash;if(n.length&&n.substring(1).length){var hSuf=n.substring(1).replace(/[!"#$%&'()*+,./:;<=>?@[\]^`{|}~]/g, "\\$&");var r=e(".vc_row, .mk-main-wrapper-holder, .mk-page-section, #comments"),t=r.filter("#"+hSuf);if(!t.length)return;n=n.replace("!loading","");var i=n+"!loading";a.hash=i}}(jQuery);
function mkPositionSidebar(){
var themeContent=$('.theme-content'),
lastFullWidthChild=themeContent.find('.vc_row-full-width').last(),
top,
sidebar=$('#theme-page > .mk-main-wrapper-holder > .theme-page-wrapper > #mk-sidebar');
if(! lastFullWidthChild.length){
sidebar.removeAttr('style');
return;
}
top=lastFullWidthChild.offset().top - themeContent.offset().top;
sidebar.css('padding-top', top);
}
function mk_accordion_toggles_tooltip(){
"use strict";
$('.box-close-btn').on('click', function(){
$(this).parent().fadeOut(300);
return false;
});
}
function mk_portfolio_ajax(){
"use strict";
var headerHeight=0;
if($.exists("#wpadminbar")){
headerHeight +=$("#wpadminbar").height();
}
if(!$.exists('.mk-vm-menuwrapper')){
headerHeight +=parseInt($('.mk-header').attr('data-sticky-height'));
}
function init(){
var $portfolio=$('.portfolio-grid.portfolio-ajax-enabled');
if(!$portfolio.length) return;
MK.core.loadDependencies([ MK.core.path.plugins + 'jquery.ajax.portfolio.js' ], function(){
setTimeout(function(){
$portfolio.each(function(){
$(this).ajaxPortfolio({ extraOffset: headerHeight });
});
}, 100);
});
}
init();
MK.utils.eventManager.subscribe('ajaxLoaded', init);
}
function mk_ajax_search(){
"use strict";
if(mk_ajax_search_option!=="beside_nav"){
return;
}
var minimumLengthToSearch=3;
var $mkAjaxSearchInput=$('#mk-ajax-search-input');
var security=$mkAjaxSearchInput.siblings('input[name="security"]').val();
var wpHttpReferer=$mkAjaxSearchInput.siblings('input[name="_wp_http_referer"]').val();
var querySpliter=(ajaxurl.indexOf('?') > -1) ? '&':'?';
var ul=document.getElementById('mk-nav-search-result');
var searchTerm;
var requestCounter=0;
var responseCounter=0;
$mkAjaxSearchInput.on('paste input propertychange', onSearchBoxInput);
function onSearchBoxInput(e){
var target=e.target||e.srcElement;
var newValue=target.value;
if(searchTerm!==newValue){
searchTerm=newValue;
ul.innerHTML='';
if(searchTerm.length >=minimumLengthToSearch){
$mkAjaxSearchInput.addClass('ajax-searching');
requestCounter++;
$.getJSON(ajaxurl + querySpliter + 'callback=?&action=mk_ajax_search&security=' + security + '&_wp_http_referer=' + wpHttpReferer + '&term=' + searchTerm)
.done(showSearchResult)
.fail(showErrorMessage);
}}
}
function showSearchResult(data){
responseCounter++;
if(isCorrectResponse()){
if(data.length > 0){
for (var i=0; i < data.length; i++){
var item=data[i];
$('').append('' + item.image + '' + item.label + ' ' + item.date + ' ').appendTo(ul);
}}else{
ul.innerHTML=' No Result. ';
}
$mkAjaxSearchInput.parent('form').removeClass('ajax-searching').addClass('ajax-search-complete');
}}
function showErrorMessage(){
responseCounter++;
if(isCorrectResponse()){
ul.innerHTML='Can not search! Please try again. ';
}}
function isCorrectResponse(){
return requestCounter===responseCounter;
}}
function mk_backgrounds_parallax(){
"use strict";
if(mk_header_parallax==true){
$('.mk-header-bg').addClass('mk-parallax-enabled');
}
if(mk_body_parallax==true){
$('body').addClass('mk-parallax-enabled');
}
if(mk_banner_parallax==true){
$('.mk-header').addClass('mk-parallax-enabled');
}
if(mk_footer_parallax==true){
$('#mk-footer').addClass('mk-parallax-enabled');
}
$('.mk-parallax-enabled').each(function (){
var $this=$(this);
if(!MK.utils.isMobile()){
MK.core.loadDependencies([ MK.core.path.plugins + 'jquery.parallax.js' ], function(){
$this.parallax("49%", 0.3);
});
}});
$('.mk-fullwidth-slideshow.parallax-slideshow').each(function (){
var $this=$(this);
if(!MK.utils.isMobile()){
MK.core.loadDependencies([ MK.core.path.plugins + 'jquery.parallax.js' ], function(){
var speed_factor=$this.attr('data-speedFactor');
$this.parallax("49%", speed_factor);
});
}});
}
function loop_audio_init(){
if($.exists('.jp-jplayer')){
$('.jp-jplayer.mk-blog-audio').each(function (){
var $this=$(this);
MK.core.loadDependencies([ MK.core.path.plugins + 'jquery.jplayer.js' ], function(){
var css_selector_ancestor="#" + $this.siblings('.jp-audio').attr('id');
var ogg_file, mp3_file, mk_theme_js_path;
ogg_file=$this.attr('data-ogg');
mp3_file=$this.attr('data-mp3');
$this.jPlayer({
ready: function (){
$this.jPlayer("setMedia", {
mp3: mp3_file,
ogg: ogg_file
});
},
play: function (){
$this.jPlayer("pauseOthers");
},
swfPath: mk_theme_js_path,
supplied: "mp3, ogg",
cssSelectorAncestor: css_selector_ancestor,
wmode: "window"
});
});
});
}}
function mk_blog_carousel(){
"use strict";
if(!$.exists('.mk-blog-showcase')){
return;
}
$('.mk-blog-showcase ul li').each(function (){
$(this).on('hover', function (){
$(this).siblings('li').removeClass('mk-blog-first-el').end().addClass('mk-blog-first-el');
});
});
}
function mk_contact_form(){
"use strict";
var mkContactForms=document.getElementsByClassName('mk-contact-form');
if(mkContactForms.length===0){
return;
}
var captchaImageHolder=$('.captcha-image-holder');
var activeClassName='is-active';
var invalidClassName='mk-invalid';
for (var i=0; i < mkContactForms.length; i++){
initializeForm(mkContactForms[i], activeClassName, invalidClassName);
}
if(captchaImageHolder.length > 0){
$(window).on('load', initializeCaptchas);
}
function initializeForm(form, activeClassName, invalidClassName){
var inputs=getFormInputs(form);
for (var i=0; i < inputs.length; i++){
markActiveClass(inputs[i]);
}
form.addEventListener('submit', function(e){
validateForm(e, invalidClassName);
});
function setActiveClass(){
addClass(this.parentNode, activeClassName);
}
function unsetActiveClass(){
if(this.value===''){
removeClass(this.parentNode, activeClassName);
}}
function markActiveClass(input){
input.addEventListener('focus', setActiveClass);
input.addEventListener('blur', unsetActiveClass);
}}
function validateForm(e, invalidClassName){
e.preventDefault();
var form=e.target||e.srcElement;
var inputs=getFormInputs(form);
var isValidForm=true;
var hasCaptchaField=false;
for (var i=0; i < inputs.length; i++){
var input=inputs[i];
input.value=String(input.value).trim();
switch (input.type){
case 'hidden':
break;
case 'checkbox':
isValidForm=validateCheckBox(input, invalidClassName)&&isValidForm;
break;
case 'email':
isValidForm=validateEmail(input, invalidClassName)&&isValidForm;
break;
case 'textarea':
isValidForm=validateText(input, invalidClassName)&&isValidForm;
break;
case 'text':
if(input.dataset.type==='captcha'){
isValidForm=validateText(input, invalidClassName)&&isValidForm;
hasCaptchaField=true;
}else if(input.dataset.type==='email'){
isValidForm=validateEmail(input, invalidClassName)&&isValidForm;
}else{
isValidForm=validateText(input, invalidClassName)&&isValidForm;
}
break;
default:
console.warn('Implement validation for ' + input.name + ':' + input.type);
break;
}}
if(isValidForm){
if(hasCaptchaField){
validateCaptcha(form, invalidClassName, sendForm);
}else{
sendForm(form);
}}
}
function validateCaptcha(form, invalidClassName, captchaIsValidCallback){
var input=form.querySelectorAll('[data-type="captcha"]')[0];
if(input.value.length===0){
addClass(input, invalidClassName);
return false;
}else{
window.get.captcha(input.value).done(function(data){
loadCaptcha();
input.value='';
if(data!=='ok'){
addClass(input, invalidClassName);
addClass(input, 'contact-captcha-invalid');
removeClass(input, 'contact-captcha-valid');
input.placeholder=mk_captcha_invalid_txt;
}else{
removeClass(input, invalidClassName);
removeClass(input, 'contact-captcha-invalid');
addClass(input, 'contact-captcha-valid');
input.placeholder=mk_captcha_correct_txt;
captchaIsValidCallback(form);
}});
}}
function sendForm(form){
var $form=$(form);
var data=getFormData(form);
progressButton.loader($form);
$.post(ajaxurl, data, function(response){
var res=JSON.parse(response);
if(res.action_Status){
progressButton.success($form);
$form.find('.text-input').val('');
$form.find('textarea').val('');
$form.find('input[type=checkbox]').attr("checked", false);
$form.find('.contact-form-message').slideDown().addClass('state-success').html(res.message);
setTimeout(function(){
$form.find('.contact-form-message').slideUp();
}, 5000);
}else{
progressButton.error($form);
$form.find('.contact-form-message').removeClass('state-success').html(res.message);
}});
}
function initializeCaptchas(){
var captchaChangeImageButtons=document.getElementsByClassName('captcha-change-image');
for (var i=0; i < captchaChangeImageButtons.length; i++){
captchaChangeImageButtons[i].addEventListener('click', loadCaptcha);
}}
function loadCaptcha(e){
if(e){
e.preventDefault();
}
$.post(ajaxurl, {
action: 'mk_create_captcha_image'
}, appendImage);
function appendImage(captchaImageURL){
if(captchaImageHolder.find('.captcha-image').length===0){
captchaImageHolder.html(' ');
}else{
captchaImageHolder.find('.captcha-image').attr("src", captchaImageURL + '?' + new Date().getTime());
}}
}
function getFormInputs(form){
return form.querySelectorAll('input,textarea');
}
function getFormData(form){
var data={
action: 'mk_contact_form'
};
var inputs=getFormInputs(form);
for (var i=0; i < inputs.length; i++){
data[inputs[i].name]=inputs[i].value;
}
return data;
}}
function mk_login_form(){
$('form.mk-login-form').each(function(){
var $this=$(this);
$this.on('submit', function(e){
$('p.mk-login-status', $this).show().text(ajax_login_object.loadingmessage);
$.ajax({
type: 'POST',
dataType: 'json',
url: ajax_login_object.ajaxurl,
data: {
'action': 'ajaxlogin',
'username': $('#username', $this).val(),
'password': $('#password', $this).val(),
'security': $('#security', $this).val()
},
success: function(data){
$('p.mk-login-status', $this).text(data.message);
if(data.loggedin===true){
document.location.href=ajax_login_object.redirecturl;
}}
});
e.preventDefault();
});
});
}
var progressButton={
loader: function(form){
MK.core.loadDependencies([MK.core.path.plugins + 'tweenmax.js'], function(){
var $form=form,
progressBar=$form.find(".mk-progress-button .mk-progress-inner"),
buttonText=$form.find(".mk-progress-button .mk-progress-button-content"),
progressButton=new TimelineLite();
progressButton.to(progressBar, 0, {
width: "100%",
scaleX: 0,
scaleY: 1
}).to(buttonText, .3, {
y: -5
}).to(progressBar, 1.5, {
scaleX: 1,
ease: Power2.easeInOut
}, "-=.1").to(buttonText, .3, {
y: 0
}).to(progressBar, .3, {
scaleY: 0
});
});
},
success: function(form){
MK.core.loadDependencies([MK.core.path.plugins + 'tweenmax.js'], function(){
var $form=form,
buttonText=$form.find(".mk-button .mk-progress-button-content, .mk-contact-button .mk-progress-button-content"),
successIcon=$form.find(".mk-progress-button .state-success"),
progressButtonSuccess=new TimelineLite({
onComplete: hideSuccessMessage
});
progressButtonSuccess.to(buttonText, .3, {
paddingRight: 20,
ease: Power2.easeInOut
}, "+=1").to(successIcon, .3, {
opacity: 1
}).to(successIcon, 2, {
opacity: 1
});
function hideSuccessMessage(){
progressButtonSuccess.reverse()
}});
},
error: function(form){
MK.core.loadDependencies([MK.core.path.plugins + 'tweenmax.js'], function(){
var $form=form,
buttonText=$form.find(".mk-button .mk-progress-button-content, .mk-contact-button .mk-progress-button-content"),
errorIcon=$form.find(".mk-progress-button .state-error"),
progressButtonError=new TimelineLite({
onComplete: hideErrorMessage
});
progressButtonError.to(buttonText, .3, {
paddingRight: 20
}, "+=1").to(errorIcon, .3, {
opacity: 1
}).to(errorIcon, 2, {
opacity: 1
});
function hideErrorMessage(){
progressButtonError.reverse()
}});
}};
function mk_click_events(){
"use strict";
var eventtype='click';
$(".mk-header-login, .mk-header-signup, .mk-side-dashboard, .mk-quick-contact-wrapper, .mk-dashboard-trigger, .blog-share-container, .news-share-buttons, .main-nav-side-search, #mk-fullscreen-search-wrapper, #fullscreen-navigation").on(eventtype, function(event){
if(event.stopPropagation){
event.stopPropagation();
}else if(window.event){
window.event.cancelBubble=true;
}});
$("html").on(eventtype, function(){
$(".mk-login-register, .mk-header-subscribe, #mk-quick-contact, .single-share-buttons, .single-share-box, .blog-social-share, .news-share-buttons, #mk-nav-search-wrapper").fadeOut(300);
$('.mk-quick-contact-link').removeClass('quick-contact-active');
});
$('.mk-fullscreen-search-overlay').on(eventtype,function(){
$(this).removeClass('mk-fullscreen-search-overlay-show');
});
$('.mk-forget-password').on(eventtype, function(){
$('.mk-forget-panel').siblings().hide().end().show();
});
$('.mk-create-account').on(eventtype, function(){
$('#mk-register-panel').siblings().hide().end().show();
});
$('.mk-return-login').on(eventtype, function(){
$('#mk-login-panel').siblings().hide().end().show();
});
$('.mk-quick-contact-link').on(eventtype, function(){
var $this=$(this),
$quickContact=$('#mk-quick-contact');
if(!$this.hasClass('quick-contact-active')){
$quickContact.addClass('quick-contact-anim').fadeIn(250);
$this.addClass('quick-contact-active');
}else{
$quickContact.removeClass('quick-contact-anim').fadeOut(100);
$this.removeClass('quick-contact-active');
}
return false;
});
}
function mk_social_share_global(){
"use strict";
var eventtype='click';
$('.twitter-share').on(eventtype, function(){
var $this=$(this),
$url=$this.attr('data-url'),
$title=$this.attr('data-title');
window.open('http://twitter.com/intent/tweet?text=' + $title + ' ' + $url, "twitterWindow", "height=380,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0");
return false;
});
$('.pinterest-share').on(eventtype, function(){
var $this=$(this),
$url=$this.attr('data-url'),
$title=$this.attr('data-title'),
$image=$this.attr('data-image');
window.open('http://pinterest.com/pin/create/button/?url=' + $url + '&media=' + $image + '&description=' + $title, "twitterWindow", "height=320,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0");
return false;
});
$('.facebook-share').on(eventtype, function(){
var $url=$(this).attr('data-url');
window.open('https://www.facebook.com/sharer/sharer.php?u=' + $url, "facebookWindow", "height=380,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0");
return false;
});
$('.googleplus-share').on(eventtype, function(){
var $url=$(this).attr('data-url');
window.open('https://plus.google.com/share?url=' + $url, "googlePlusWindow", "height=380,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0");
return false;
});
$('.linkedin-share').on(eventtype, function(){
var $this=$(this),
$url=$this.attr('data-url'),
$title=$this.attr('data-title'),
$desc=$this.attr('data-desc');
window.open('http://www.linkedin.com/shareArticle?mini=true&url=' + $url + '&title=' + $title + '&summary=' + $desc, "linkedInWindow", "height=380,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0");
return false;
});
}
function mk_event_countdown(){
if($.exists('.mk-event-countdown')){
MK.core.loadDependencies([ MK.core.path.plugins + 'jquery.countdown.js' ], function(){
$('.mk-event-countdown').each(function (){
if(isTest) return;
var $this=$(this),
$date=$this.attr('data-date'),
$offset=$this.attr('data-offset');
$this.downCount({
date: $date,
offset: $offset
});
});
});
}}
function mk_flexslider_init(){
var $lcd=$('.mk-lcd-slideshow'),
$laptop=$('.mk-laptop-slideshow-shortcode');
if($lcd.length) $lcd.find('.mk-lcd-image').fadeIn();
if($laptop.length) $laptop.find(".mk-laptop-image").fadeIn();
$('.js-flexslider').each(function (){
if($(this).parents('.mk-tabs').length||$(this).parents('.mk-accordion').length){
$(this).removeData("flexslider");
}
var $this=$(this),
$selector=$this.attr('data-selector'),
$animation=$this.attr('data-animation'),
$easing=$this.attr('data-easing'),
$direction=$this.attr('data-direction'),
$smoothHeight=$this.attr('data-smoothHeight')=="true" ? true:false,
$slideshowSpeed=$this.attr('data-slideshowSpeed'),
$animationSpeed=$this.attr('data-animationSpeed'),
$controlNav=$this.attr('data-controlNav')=="true" ? true:false,
$directionNav=$this.attr('data-directionNav')=="true" ? true:false,
$pauseOnHover=$this.attr('data-pauseOnHover')=="true" ? true:false,
$isCarousel=$this.attr('data-isCarousel')=="true" ? true:false;
if($selector!==undefined){
var $selector_class=$selector;
}else{
var $selector_class=".mk-flex-slides > li";
}
if($isCarousel===true){
var $itemWidth=parseInt($this.attr('data-itemWidth')),
$itemMargin=parseInt($this.attr('data-itemMargin')),
$minItems=parseInt($this.attr('data-minItems')),
$maxItems=parseInt($this.attr('data-maxItems')),
$move=parseInt($this.attr('data-move'));
}else{
var $itemWidth=$itemMargin=$minItems=$maxItems=$move=0;
}
MK.core.loadDependencies([ MK.core.path.plugins + 'jquery.flexslider.js' ], function(){
$this.flexslider({
selector: $selector_class,
animation: $animation,
easing: $easing,
direction: $direction,
smoothHeight: $smoothHeight,
slideshow: !isTest,
slideshowSpeed: $slideshowSpeed,
animationSpeed: $animationSpeed,
controlNav: $controlNav,
directionNav: $directionNav,
pauseOnHover: $pauseOnHover,
prevText: "",
nextText: "",
itemWidth: $itemWidth,
itemMargin: $itemMargin,
minItems: $minItems,
maxItems: $maxItems,
move: $move
});
});
});
}
function mk_header_searchform(){
$('.mk-search-trigger').click(function(){
setTimeout(function(){
$('#mk-ajax-search-input').focus();
},500);
});
"use strict";
$('.mk-header-toolbar .mk-header-searchform .text-input').on('focus', function (){
if($('.mk-header-toolbar .mk-header-searchform .text-input').hasClass('on-close-state')){
$('.mk-header-toolbar .mk-header-searchform .text-input').removeClass('on-close-state').animate({
'width': '200px'
}, 200);
return false;
}});
$(".mk-header-toolbar .mk-header-searchform").click(function (event){
if(event.stopPropagation){
event.stopPropagation();
}else if(window.event){
window.event.cancelBubble=true;
}});
$("html").click(function (){
$(this).find(".mk-header-toolbar .mk-header-searchform .text-input").addClass('on-close-state').animate({
'width': 90
}, 300);
});
if(MK.utils.browser.name==='Edge'){
$('#mk-fullscreen-search-input').on('keydown', function(e){
if(e.which==13){
e.preventDefault();
$('#mk-fullscreen-searchform').submit();
}});
}}
function mk_hover_events(){
"use strict";
$('.shopping-cart-header').hover(function(){
$(this).find('.mk-shopping-cart-box').stop(true, true).fadeIn(250);
},
function(){
$(this).find('.mk-shopping-cart-box').stop(true, true).fadeOut(250);
}
);
$('.widget-sub-navigation > ul > li, .widget_nav_menu ul.menu > li, .widget_product_categories ul > .cat-item').each(function(){
var $this=$(this),
$subLevel=$this.find('ul').first();
if($this.hasClass('page_item_has_children')||$this.hasClass('menu-item-has-children')||$this.hasClass('cat-parent')){
$this.on('click', function(){
if($this.hasClass('toggle-active')){
$subLevel.stop(true, true).slideUp(700);
$this.removeClass('toggle-active');
}else{
$subLevel.stop(true, true).slideDown(700);
$this.addClass('toggle-active');
}});
$subLevel.on('click', function(e){
e.stopPropagation();
});
}});
var eventtype='click';
$('.mk-fullscreen-trigger').on(eventtype, function(e){
$('.mk-fullscreen-search-overlay').addClass('mk-fullscreen-search-overlay-show');
setTimeout(function(){
$("#mk-fullscreen-search-input").focus();
}, 300);
e.preventDefault();
});
$('.mk-fullscreen-close').on(eventtype, function(e){
$('.mk-fullscreen-search-overlay').removeClass('mk-fullscreen-search-overlay-show');
e.preventDefault();
});
}
function mk_unfold_footer(){
var $this=$('#mk-footer'),
$spacer=$('#mk-footer-unfold-spacer'),
$footerHeight=$this.outerHeight();
if(!window.matchMedia("(max-width: 767px)").matches){
if($this.hasClass('mk-footer-unfold')){
$spacer.css('height', $footerHeight);
}}else{
$spacer.css('height', 0);
}}
function mk_lightbox_init(){
var $lightbox=$(".mk-lightbox");
$lightbox.fancybox({
padding: 15,
margin: 15,
width: 800,
height: 600,
minWidth: 100,
minHeight: 100,
maxWidth: 9999,
maxHeight: 9999,
pixelRatio: 1,
autoSize: true,
autoHeight: false,
autoWidth: false,
autoResize: true,
fitToView: true,
aspectRatio: false,
topRatio: 0.5,
leftRatio: 0.5,
scrolling: 'auto', // 'auto', 'yes' or 'no'
wrapCSS: '',
arrows: true,
closeBtn: true,
closeClick: false,
nextClick: false,
mouseWheel: true,
autoPlay: false,
playSpeed: 3000,
preload: 3,
modal: false,
loop: true,
openEffect: 'fade', // 'elastic', 'fade' or 'none'
openSpeed: 200,
openEasing: 'swing',
openOpacity: true,
openMethod: 'zoomIn',
closeEffect: 'fade', // 'elastic', 'fade' or 'none'
closeSpeed: 200,
closeEasing: 'swing',
closeOpacity: true,
closeMethod: 'zoomOut',
nextEffect: 'none', // 'elastic', 'fade' or 'none'
nextSpeed: 350,
nextEasing: 'swing',
nextMethod: 'changeIn',
prevEffect: 'none', // 'elastic', 'fade' or 'none'
prevSpeed: 350,
prevEasing: 'swing',
prevMethod: 'changeOut',
helpers:{
media:{},
overlay: {
locked: true
}},
tpl: {
wrap: '',
image: ' ',
error: 'The requested content cannot be loaded. Please try again later.
',
closeBtn: ' ',
next: ' ',
prev: ' ',
loading: ''
},
afterLoad: function(){
$('html').addClass('fancybox-lock');
$('.fancybox-wrap').appendTo('.fancybox-overlay');
},
beforeShow: function(){
this.locked=true;
},
afterClose: function(){
var galleryParent=this.element.parents('.mk-gallery-item');
if(galleryParent){
galleryParent.removeClass('hover-state');
}}
});
}
function mk_milestone(){
"use strict";
if(isTest||!$.exists('.mk-milestone')) return;
$('.mk-milestone').each(function (){
var $this=$(this),
stop_number=$this.find('.milestone-number').attr('data-stop'),
animation_speed=parseInt($this.find('.milestone-number').attr('data-speed'));
var build=function(){
if(!$this.hasClass('scroll-animated')){
$this.addClass('scroll-animated');
$({
countNum: $this.find('.milestone-number').text()
}).animate({
countNum: stop_number
}, {
duration: animation_speed,
easing: 'linear',
step: function (){
$this.find('.milestone-number').text(Math.floor(this.countNum));
},
complete: function (){
$this.find('.milestone-number').text(this.countNum);
}});
}};
if(!MK.utils.isMobile()){
MK.utils.scrollSpy(this, {
position: 'bottom',
after: build
});
}else{
build();
}});
}
function mk_portfolio_widget(){
"use strict";
$('.widget_recent_portfolio li').each(function (){
$(this).find('.portfolio-widget-thumb').hover(function (){
$(this).siblings('.portfolio-widget-info').animate({
'opacity': 1
}, 200);
}, function (){
$(this).siblings('.portfolio-widget-info').animate({
'opacity': 0
}, 200);
});
});
}
function mk_skill_meter(){
"use strict";
if($.exists('.mk-skill-meter')){
if(!MK.utils.isMobile()){
$(".mk-skill-meter .progress-outer").each(function(){
var $this=$(this);
var build=function(){
if(!$this.hasClass('scroll-animated')){
$this.addClass('scroll-animated');
$this.animate({
width: $this.attr("data-width") + '%'
}, 2000);
}};
MK.utils.scrollSpy(this, {
position: 'bottom',
after: build
});
});
}else{
$(".mk-skill-meter .progress-outer").each(function(){
var $this=$(this);
if(!$this.hasClass('scroll-animated')){
$this.addClass('scroll-animated');
$this.css({
width: $(this).attr("data-width") + '%'
});
}});
}}
}
$("#mc-embedded-subscribe-form").submit(function(e){
var $this=$(this);
e.preventDefault();
$.ajax({
url: MK.core.path.ajaxUrl,
type: "POST",
data: {
action: "mk_ajax_subscribe",
email: $this.find(".mk-subscribe--email").val(),
list_id: $this.find(".mk-subscribe--list-id").val(),
optin: $this.find(".mk-subscribe--optin").val()
},
success: function(res){
$this.parent().find(".mk-subscribe--message").html($.parseJSON(res).message);
}});
});
function addClass(tag, className){
tag.className +=' ' + className;
}
function removeClass(tag, className){
tag.className=tag.className.replace(new RegExp(className, 'g'), '');
}
if(typeof exports!=='undefined'){
exports.addClass=addClass;
exports.removeClass=removeClass;
}
(function(root, factory){
if(typeof define==="function"&&define.amd){
define([], factory);
}else if(typeof exports==="object"){
module.exports=factory();
}else{
root.debounce=factory();
}})(this, function(){
"use strict";
return function(callback, delay){
var timeout;
return function(){
var context=this, args=arguments;
clearTimeout(timeout);
timeout=setTimeout(function(){
callback.apply(context, args);
}, delay);
};};
});
function validateEmail(input, invalidClassName){
var value=input.value.trim();
if((input.required||value.length > 0)&&!/^([a-z0-9_\.\-\+]+)@([\da-z\.\-]+)\.([a-z\.]{2,63})$/i.test(value)){
if(invalidClassName){
addClass(input, invalidClassName);
}
return false;
}else{
if(invalidClassName){
removeClass(input, invalidClassName);
}
return true;
}}
function validateText(input, invalidClassName){
var value=input.value.trim();
if(input.required&&value.length===0){
if(invalidClassName){
addClass(input, invalidClassName);
}
return false;
}else{
if(invalidClassName){
removeClass(input, invalidClassName);
}
return true;
}}
function validateCheckBox(input, invalidClassName){
if(input.required&&input.checked==false){
if(invalidClassName){
addClass(input, invalidClassName);
}
return false;
}else{
if(invalidClassName){
removeClass(input, invalidClassName);
}
return true;
}}
if(typeof exports!=='undefined'){
exports.validateEmail=validateEmail;
exports.validateText=validateText;
}
(function($){
'use strict';
var $wrapper=$('.js-bottom-corner-btns');
var $contactBtn=$wrapper.find('.js-bottom-corner-btn--contact');
var $backBtn=$wrapper.find('.js-bottom-corner-btn--back');
var hasContactBtn=$contactBtn.length;
var hasBackBtn=$backBtn.length;
if(!hasBackBtn) return;
function deactivate(){
$contactBtn.removeClass('is-active');
$backBtn.removeClass('is-active');
}
function activate(){
$contactBtn.addClass('is-active');
$backBtn.addClass('is-active');
}
MK.utils.scrollSpy(400, {
before: deactivate,
after: activate
});
})(jQuery);
(function($){
'use strict';
$('.mk-fullscreen-nav-close, .mk-fullscreen-nav-wrapper, #fullscreen-navigation a').on('click', function(e){
$('.mk-fullscreen-nav').removeClass('opened');
$('.mk-dashboard-trigger').removeClass('fullscreen-active');
$('body').removeClass('fullscreen-nav-opened');
var anchor=MK.utils.detectAnchor(this),
$this=$(this);
if(anchor.length){
var href=$this.attr('href').split('#')[0];
var url=window.location.href;
var isSamePage=url.indexOf(href)!==-1;
if(isSamePage){
e.preventDefault();
}
MK.utils.scrollToAnchor(anchor);
}else if($this.attr('href')==='#'){
e.preventDefault();
}});
$('.fullscreen-navigation-ul .menu-sub-level-arrow').on('click', function(){
$(this).siblings('.sub-menu').slideToggle();
});
}(jQuery));
(function($){
'use strict';
var $navList=$(".main-navigation-ul");
var megaMenu=function megaMenu(){
$navList.MegaMenu({
type: "vertical",
delay: 200
});
};
$(window).on('load', megaMenu);
}(jQuery));
(function($){
'use strict';
var onePageNavItem=function onePageNavItem(){
var $this=$(this),
link=$this.find('a'),
anchor=MK.utils.detectAnchor(link);
if(!anchor.length) return;
$this.removeClass('current-menu-item current-menu-ancestor current-menu-parent');
var activeNav=function(state){
return function(){
$this[ state ? 'addClass':'removeClass' ]('current-menu-item');
window.history.replaceState(undefined, undefined, [ state ? anchor:' ' ]);
};};
MK.utils.scrollSpy($(anchor)[0], {
before:activeNav(false),
active:activeNav(true),
after:activeNav(false),
});
};
var $navItems=$('.js-main-nav').find('li');
$(window).on('load', function(){
setTimeout(function(){
$navItems.each(onePageNavItem);
}, 1000);
});
}(jQuery));
(function($){
'use strict';
var $window=$(window);
var $body=$('body');
var $resMenuWrap=$('.mk-responsive-wrap');
var $post_nav=$('.mk-post-nav');
var $toolbar=$('.mk-header-toolbar');
var $resMenuLink=$('.mk-nav-responsive-link');
var hasResMenu=($resMenuWrap.length > 0);
var windowHeight=$window.height();
var screenHeight=screen.height;
$('.mk-toolbar-resposnive-icon').on('click', function(e){
e.preventDefault();
console.log('clicked');
if($body.hasClass('toolbar-opened')){
$body.removeClass('toolbar-opened').addClass('toolbar-closed');
$toolbar.hide();
}else{
$body.removeClass('toolbar-closed').addClass('toolbar-opened');
$toolbar.show();
}});
if(! hasResMenu&&! $('.vc_mk_header')) return;
function toggleResMenu(e){
e.preventDefault();
var $this=$(this);
var $headerInner=$this.parents('header');
var $resMenu=$headerInner.find('.mk-responsive-wrap');
var searchBox=$('.responsive-searchform .text-input');
var adminBarHeight=$('#wpadminbar').height();
if($body.hasClass('mk-opened-nav')){
$this.removeClass('is-active');
$body.removeClass('mk-opened-nav').addClass('mk-closed-nav').trigger('mk-closed-nav');
$resMenu.hide();
$post_nav.removeClass('post-nav-backward');
}else{
$this.addClass('is-active');
$body.removeClass('mk-closed-nav').addClass('mk-opened-nav').trigger('mk-opened-nav');
$resMenu.show();
$post_nav.addClass('post-nav-backward');
}
if(searchBox.hasClass('input-focused')){
searchBox.removeClass('input-focused');
}}
$resMenuLink.each(function(){
$(this).on('click', toggleResMenu);
});
$(window).on('vc_reload', function (){
$('.vc_mk_header .mk-nav-responsive-link').each(function(){
$(this).on('click', toggleResMenu);
});
})
var setResMenuHeight=function(){
var height=$window.height() - MK.val.offsetHeaderHeight(0);
$resMenuWrap.css('max-height', height);
};
var isVirtualKeyboard=function(){
var currentWindowHeight=$window.height();
var currentScreenHeight=screen.height;
var searchBox=$('.responsive-searchform .text-input');
var searchBoxIsFocused=false;
searchBox.on('touchstart touchend', function(e){
searchBox.addClass('input-focused');
});
searchBoxIsFocused=(searchBox.is(':focus')||searchBox.hasClass("input-focused"));
if($body.hasClass('mk-opened-nav')&&searchBoxIsFocused&¤tScreenHeight==screenHeight&¤tWindowHeight!=windowHeight){
return true;
}else{
return false;
}};
var hideResMenu=function hideResMenu(){
if(MK.utils.isResponsiveMenuState()){
if(!isVirtualKeyboard()){
if($body.hasClass('mk-opened-nav')){
$resMenuLink.filter('.is-active').trigger('click');
}
$resMenuWrap.hide();
}}
};
$resMenuWrap.on('click', 'a', hideResMenu);
}(jQuery));
(function($){
'use strict';
var $header=$('.mk-header');
var hasHeader=($header.length > 0);
if(!hasHeader&&! $('.vc_mk_header')) return;
var $sticky_style=$header.attr('data-header-style');
$('.sidedash-navigation-ul > li').each(function(){
var $this=$(this);
$this.children('ul').siblings('a').after(' ');
});
function toggleSubMenu(e){
e.preventDefault();
var $this=$(this);
if($this.hasClass('mk-nav-sub-closed')){
$this.siblings('ul').slideDown(450).end().removeClass('mk-nav-sub-closed').addClass('mk-nav-sub-opened');
}else{
$this.siblings('ul').slideUp(450).end().removeClass('mk-nav-sub-opened').addClass('mk-nav-sub-closed');
}};
function toggleFullMenu(e){
e.preventDefault();
var $this=$(this),
$body=$('body'),
$fullscreen_box=$('.mk-fullscreen-nav');
if($this.hasClass('dashboard-style')){
if(!$this.hasClass('dashboard-active')){
$this.addClass('dashboard-active');
$body.addClass('dashboard-opened');
}else{
$this.removeClass('dashboard-active');
$body.removeClass('dashboard-opened');
}}else if($this.hasClass('fullscreen-style')){
if(!$this.hasClass('fullscreen-active')){
$this.addClass('fullscreen-active');
$body.addClass('fullscreen-nav-opened');
$fullscreen_box.addClass('opened');
}else{
$this.removeClass('fullscreen-active');
$body.removeClass('fullscreen-nav-opened');
$fullscreen_box.removeClass('opened');
}}
}
$('.mk-nav-arrow').each(function(){
$(this).stop(true).on('click', toggleSubMenu);
});
$('.mk-dashboard-trigger').each(function(){
$(this).on('click', toggleFullMenu);
});
$(window).on('vc_reload', function (){
$('.vc_mk_header .mk-dashboard-trigger').each(function(){
$(this).on('click', toggleFullMenu);
});
$('.vc_mk_header .mk-nav-arrow').each(function(){
$(this).stop(true).on('click', toggleSubMenu);
});
});
$('html').on('click', function(){
$('body').removeClass('dashboard-opened');
$('.mk-dashboard-trigger').removeClass('dashboard-active');
});
}(jQuery));
(function($){
'use strict';
var $verticalMenu=$('#mk-vm-menu');
var verticalMenu=function verticalMenu(){
if(!$verticalMenu.data('vertical-menu')&&!MK.utils.isResponsiveMenuState()){
$verticalMenu.dlmenu();
$verticalMenu.data('vertical-menu', true);
}};
verticalMenu();
$(window).on('resize', verticalMenu);
}(jQuery));
(function($){
'use strict';
var $lang_item=$('.mk-main-navigation > .main-navigation-ul > .menu-item-language');
$lang_item.addClass('no-mega-menu').css('visibility', 'visible');
$('.mk-main-navigation .menu-item-language > a').addClass('menu-item-link');
})(jQuery);
(function($){
'use strict';
var $header=$('.mk-header').first();
var hasHeader=($header.length > 0);
if(!hasHeader) return;
var $window=$(window);
var $document=$(document);
var $headerHolder=$header.find('.mk-header-holder');
var $paddingWrapper=$header.find('.mk-header-padding-wrapper');
var config=$header.data();
var isStickyLazy=(config.stickyStyle==='lazy');
var isStickyFixed=(config.stickyStyle==='fixed');
var isStickySlide=(config.stickyStyle==='slide');
function isSticky(){
return true;
}
function isColorable(){
return config.headerStyle!==4;
}
function changeSkin(e, skin){
$header.attr('data-transparent-skin', skin);
var contrast=skin==='light' ? 'dark':'light';
$header.addClass(skin + '-skin');
$header.removeClass(contrast + '-skin');
}
if(isColorable()) MK.utils.eventManager.subscribe('firstElSkinChange', changeSkin);
if(isSticky()&&isStickyLazy){
if(config.headerStyle!==2){
lazySticky();
}}
else if(isSticky()&&isStickyFixed) fixedSticky();
else if(isSticky()&&isStickySlide) slideSticky();
function lazySticky(){
var elClassHidden='header--hidden';
var elClassSticky='a-sticky';
var wScrollCurrent=0;
var wScrollBefore=0;
var wScrollDiff=0;
var wHeight=0;
var dHeight=0;
var setSizes=function setSizes(){
dHeight=$document.height();
wHeight=$window.height();
};
var onScroll=function onScroll(){
wScrollCurrent=MK.val.scroll();
wScrollDiff=wScrollBefore - wScrollCurrent;
if(wScrollCurrent <=0){
$headerHolder.removeClass(elClassHidden);
$header.removeClass(elClassSticky);
$('body').trigger('mk:header-unsticky');
}else if(wScrollDiff > 0&&$headerHolder.hasClass(elClassHidden)){
$headerHolder.removeClass(elClassHidden);
$header.addClass(elClassSticky);
$('body').trigger('mk:header-sticky');
}else if(wScrollDiff < 0){
if(wScrollCurrent + wHeight >=dHeight&&$headerHolder.hasClass(elClassHidden)){
$headerHolder.removeClass(elClassHidden);
$header.addClass(elClassSticky);
$('body').trigger('mk:header-sticky');
}else{
$headerHolder.addClass(elClassHidden);
$header.removeClass(elClassSticky);
$('body').trigger('mk:header-unsticky');
}}
wScrollBefore=wScrollCurrent;
};
setSizes();
onScroll();
$window.on('resize', MK.utils.throttle(100, setSizes));
$window.on('scroll', MK.utils.throttle(500, onScroll));
}
function fixedSticky(){
var sticked=false;
var scrollPos;
var toggleState=function toggleState(){
scrollPos=MK.val.scroll() + MK.val.adminbarHeight();
if((scrollPos > MK.val.stickyOffset())&&! MK.utils.isResponsiveMenuState()){
if(sticked) return;
$header.addClass('a-sticky');
sticked=true;
$('body').trigger('mk:header-sticky');
}else{
if(!sticked) return;
$header.removeClass('a-sticky');
sticked=false;
$('body').trigger('mk:header-unsticky');
}};
toggleState();
$window.on('scroll', MK.utils.throttle(100, toggleState));
$window.on('resize', MK.utils.throttle(100, toggleState));
}
function slideSticky(){
var sticked=false;
var onScroll=function onScroll(){
if(MK.val.scroll() > MK.val.stickyOffset()){
if(sticked) return;
$header.addClass('pre-sticky');
$paddingWrapper.addClass('enable-padding');
setTimeout(function(){
$header.addClass('a-sticky');
$('body').trigger('mk:header-sticky');
}, 1);
sticked=true;
}else{
if(!sticked) return;
$header.removeClass('a-sticky');
$header.removeClass('pre-sticky');
$paddingWrapper.removeClass('enable-padding');
sticked=false;
$('body').trigger('mk:header-unsticky');
}};
onScroll();
$window.on('scroll', MK.utils.throttle(100, onScroll));
}})(jQuery);
(function($){
'use strict';
var hasTouchscreen=('ontouchstart' in document.documentElement);
if(!hasTouchscreen) return;
$('.mk-main-navigation .menu-item-has-children').each(normalizeClick);
function normalizeClick(){
$(this).on('click', handleClick);
}
function handleClick(e){
var $this=$(e.currentTarget);
var $child=$this.find('> ul');
var isVisible=$child.css('display')!=='none';
if(!isVisible){
e.preventDefault();
e.stopPropagation();
}}
}(jQuery));
(function($){
'use strict';
MK.ui.preloader={
dom:{
overlay: '.mk-body-loader-overlay'
},
hide:function hide(){
$(this.dom.overlay).fadeOut(600, "easeInOutExpo", function(){
$('body').removeClass('loading');
});
}};})(jQuery);
(function($){
'use strict';
var _ajaxUrl=MK.core.path.ajaxUrl;
var _instances={};
MK.utils.ajaxLoader=function ajaxLoader(el){
var id='#' + ($(el).attr('id'));
if(typeof _instances[id]!=='undefined') return _instances[id];
this.id=id;
this.el=el;
this.isLoading=false;
this.xhrCounter=0;
};
MK.utils.ajaxLoader.prototype={
init: function init(){
if(this.initialized&&typeof window.vc_iframe==='undefined'){
return;
}
this.createInstance();
this.cacheElements();
this.initialized=true;
},
cacheElements: function cacheElements(){
this.$container=$(this.el);
this.id='#' + (this.$container.attr('id'));
this.categories=this.$container.data('loop-categories');
this.data={};
this.data.action='mk_load_more';
this.data.query=this.$container.data('query');
this.data.atts=this.$container.data('loop-atts');
this.data.loop_iterator=this.$container.data('loop-iterator');
this.data.author=this.$container.data('loop-author');
this.data.posts=this.$container.data('loop-posts');
this.data.safe_load_more=this.$container.siblings('#safe_load_more').val();
this.data._wp_http_referer=this.$container.siblings('input[name="_wp_http_referer"]').val();
this.data.paged=1;
this.data.maxPages=this.$container.data('max-pages');
this.data.term=this.categories;
},
createInstance: function(){
_instances[this.id]=this;
},
load: function load(unique){
var self=this;
var seq=++this.xhrCounter;
this.isLoading=true;
if(this.$container.siblings('.mk-ajax-loaded-posts').length){
var loaded_posts=this.$container.siblings('.mk-ajax-loaded-posts').attr('data-loop-loaded-posts');
if(this.$container.attr('data-pagination-style')!=1){
self.data.loaded_posts=loaded_posts.split(',');
}}
return $.when($.ajax({
url:_ajaxUrl,
type:"POST",
data:self.data
})
).done(function(response){
self.onDone(response, unique, seq);
});
},
onDone: function(response, unique, seq){
if(seq===this.xhrCounter){
var self=this;
response=$.parseJSON(response);
response.unique=unique;
response.id=this.id;
if(this.$container.siblings('.mk-ajax-loaded-posts').length){
this.$container.siblings('.mk-ajax-loaded-posts').attr('data-loop-loaded-posts', response.loaded_posts);
}
this.setData({
maxPages: response.maxPages,
found_posts: response.found_posts,
loop_iterator: response.i
});
$(response.content).mk_imagesLoaded().then(function(){
MK.utils.eventManager.publish('ajaxLoaded', response);
self.isLoading=false;
self.initNewComponents();
});
} else console.log('XHR request nr '+ seq +' aborted');
},
setData: function setData(atts){
for(var att in atts){
if(att==='term'&&atts[att]==='*') this.data.term='';
else this.data[att]=atts[att];
}},
getData: function getData(att){
return this.data[att];
},
initNewComponents: function initNewComponents(){
window.ajaxInit();
setTimeout(window.ajaxDelayedInit, 1000);
MK.core.initAll(this.el);
}};}(jQuery));
(function($){
'use strict';
var val=MK.val;
MK.component.FullHeight=function(el){
var $window=$(window),
$this=$(el),
config=$this.data('fullheight-config'),
container=document.getElementById('mk-theme-container'),
minH=(config&&config.min) ? config.min:0,
winH=null,
height=null,
update_count=0,
testing=MK.utils.getUrlParameter('testing'),
offset=null;
if(MK.utils.browser.name===('IE'||'Edge')) $this.css('height', '1px');
var update=function(){
if(update_count===0){
winH=$window.height();
offset=$this.offset().top - 1;
height=Math.max(minH, winH - val.offsetHeaderHeight(offset));
$this.css('min-height', height);
if(testing!==undefined)
update_count++;
}};
var init=function(){
update();
$window.on('resize', update);
$window.on('scroll', update);
window.addResizeListener(container, update);
};
return {
init:init
};};
})(jQuery);
MK.component.BackgroundImageSetter=(function ($){
'use strict';
var module={};
var $win=$(window),
screen=getScreenSize(),
orientation=getOrientation(),
device=getDevice(),
lastOrientation=orientation,
lastDevice=device;
function run($layers){
$layers.filter(function(){
return !this.hasAttribute("mk-img-loaded");
}).each(applyBg);
}
function applyBg(){
var $this=$(this),
imgs=$this.data('mk-img-set');
$this.css('background-image', 'url('+ module.getImage(imgs) +')');
$this.find('.mk-adaptive-image').attr('src', module.getImage(imgs));
}
function handleResize($layers){
updateScreenSize();
if(hasSwitched()){
updateDevice();
run($layers);
}}
function getScreenSize(){
return {
w: $win.width(),
h: $win.height()
};}
function getDevice(){
if(screen.w > 1024) return {class: 'desktop', id: 2};
else if(screen.w > 736) return {class: 'tablet', id: 1};
else return {class: 'mobile', id: 0};}
function getOrientation(){
if(screen.w > screen.h) return 'landscape';
else return 'portrait';
}
function updateScreenSize(){
screen=getScreenSize();
}
function updateDevice(){
if(lastOrientation!==orientation) orientation=lastOrientation;
if(lastDevice.id > device.id) device=lastDevice;
}
function hasSwitched(){
lastOrientation=getOrientation();
lastDevice=getDevice();
if(lastOrientation!==orientation||lastDevice.class!==device.class) return true;
else return false;
}
module.getImage=function (imgs){
if(imgs['responsive']==='false'){
return (imgs['landscape']['desktop']) ? imgs['landscape']['desktop']:(imgs['landscape']['external'] ? imgs['landscape']['external']:'');
}
var hasOrientation = !!imgs[orientation];
var imgOriented=imgs[ (hasOrientation ? orientation:Object.keys(imgs)[0]) ],
imgExact=(imgOriented[device.class]) ? imgOriented[device.class]:(imgOriented['external'] ? imgOriented['external']:'');
return imgExact;
}
module.init=function ($layers){
run($layers);
$layers.attr('mk-img-loaded', '');
};
module.onResize=function ($layers){
$win.on('resize', MK.utils.throttle(500, function(){
handleResize($layers);
}));
};
return module;
}(jQuery));
jQuery(function($){
var init=function init(){
$allLayers=$('[data-mk-img-set]').filter(function(index){
return !$(this).hasClass('mk-section-image')&&!$(this).hasClass('background-layer')&&!$(this).hasClass('mk-video-section-touch');
});;
MK.component.BackgroundImageSetter.onResize($allLayers);
MK.component.BackgroundImageSetter.init($allLayers);
}
init();
$(window).on('vc_reload', init);
});
(function($){
'use strict';
var core=MK.core,
utils=MK.utils,
path=MK.core.path;
MK.ui.FullScreenGallery=function(element, settings){
this.element=element;
this.config=settings;
this.isFullScreen=false;
};
MK.ui.FullScreenGallery.prototype={
dom:{
fullScrBtn:'.slick-full-screen',
exitFullScrBtn:'.slick-minimize',
playBtn:'.slick-play',
pauseBtn:'.slick-pause',
shareBtn:'.slick-share',
socialShare:'.slick-social-share',
wrapper:'.slick-slider-wrapper',
slider:'.slick-slides',
slides:'.slick-slide',
dots:'.slick-dot',
active:'.slick-active',
hiddenClass:'is-hidden',
dataId:'slick-index'
},
tpl: {
dot:'
',
next:' ',
prev:' '
},
init:function(){
var self=this;
self.cacheElements();
self.getViewportSizes();
self.updateSizes('window');
self.create();
self.updateCacheElements();
self.createPagination();
self.bindEvents();
},
create:function(){
var self=this;
this.slick=this.$gallery.slick({
dots: true,
arrows: true,
infinite: true,
speed: 300,
slidesToShow: 1,
centerMode: true,
centerPadding: '0px',
variableWidth: true,
autoplay: false,
autoplaySpeed: 3000,
useTransform: true,
prevArrow: self.tpl.prev,
nextArrow: self.tpl.next,
customPaging: function(slider, i){
return self.tpl.dot;
},
});
},
cacheElements:function(){
this.$window=$(window);
this.$gallery=$(this.element);
this.$fullScrBtn=$(this.dom.fullScrBtn);
this.$exitFullScrBtn=$(this.dom.exitFullScrBtn);
this.$playBtn=$(this.dom.playBtn);
this.$pauseBtn=$(this.dom.pauseBtn);
this.$shareBtn=$(this.dom.shareBtn);
this.$socialShare=$(this.dom.socialShare);
this.$wrapper=$(this.dom.wrapper);
this.$slider=$(this.dom.slider);
this.$slides=$(this.dom.slides);
this.$imgs=this.$slides.find('img');
this.$originalImgs=this.$imgs;
},
updateCacheElements:function(){
this.$slides=$(this.dom.slides);
this.$imgs=this.$slides.find('img');
this.$dots=$(this.dom.dots);
},
bindEvents:function(){
var self=this;
this.$fullScrBtn.on('click', this.toFullScreen.bind(this));
this.$exitFullScrBtn.on('click', this.exitFullScreen.bind(this));
this.$playBtn.on('click', this.play.bind(this));
this.$pauseBtn.on('click', this.pause.bind(this));
this.$shareBtn.on('click', this.toggleShare.bind(this));
this.$socialShare.on('click', 'a', this.socialShare.bind(this));
this.$window.on('resize', this.onResize.bind(this));
this.$window.on('keydown', function(e){
if(e.keyCode===39) self.$gallery.slick('slickNext');
if(e.keyCode===37) self.$gallery.slick('slickPrev');
});
$(document).on('fullscreenchange mozfullscreenchange webkitfullscreenchange msfullcreenchange', this.exitFullScreen.bind(this));
},
getViewportSizes:function(){
this.screen={
w: screen.width,
h: screen.height
};
this.window={
w: this.$window.width(),
h: this.$window.height()
};},
updateSizes:function(viewport){
this.$wrapper.width(this[ viewport ].w);
this.$wrapper.height('100%');
this.$imgs.height('100%');
},
createPagination:function(){
var self=this;
this.$dots.each(function(i){
var img=self.$originalImgs.eq(i).attr('src');
$(this).css({
'background-image': 'url('+ img +')'
});
});
},
play:function(e){
e.preventDefault();
this.$playBtn.addClass(this.dom.hiddenClass);
this.$pauseBtn.removeClass(this.dom.hiddenClass);
$(this.element).slick('slickPlay');
},
pause:function(e){
e.preventDefault();
this.$pauseBtn.addClass(this.dom.hiddenClass);
this.$playBtn.removeClass(this.dom.hiddenClass);
$(this.element).slick('slickPause');
},
toggleShare:function(e){
e.preventDefault();
this.$socialShare.toggleClass(this.dom.hiddenClass);
},
getCurentId:function(){
return this.$slides.filter(this.dom.active).data(this.dom.dataId);
},
toFullScreen:function(){
var self=this;
this.$fullScrBtn.addClass(this.dom.hiddenClass);
this.$exitFullScrBtn.removeClass(this.dom.hiddenClass);
this.$slider.hide().fadeIn(500);
utils.launchIntoFullscreen(document.documentElement);
this.updateSizes('screen');
$(this.element).slick('slickGoTo', this.getCurentId(), true);
setTimeout(function(){
self.isFullScreen=true;
}, 1000);
},
exitFullScreen:function(){
if(this.isFullScreen){
this.$exitFullScrBtn.addClass(this.dom.hiddenClass);
this.$fullScrBtn.removeClass(this.dom.hiddenClass);
utils.exitFullscreen();
this.updateSizes('window');
$(this.element).slick('slickGoTo', this.getCurentId(), true);
this.isFullScreen=false;
}},
onResize:function(){
this.getViewportSizes();
this.updateSizes(this.isFullScreen ? 'screen':'window');
$(this.element).slick('refresh');
$(this.element).slick('slickGoTo', this.getCurentId(), true);
this.updateCacheElements();
this.createPagination();
},
socialShare:function(e){
e.preventDefault();
var $this=$(e.currentTarget),
network=$this.data('network'),
id=this.config.id,
url=this.config.url,
title=this.$wrapper.find('.slick-title').text(),
name;
var picture=this.$slides.filter(this.dom.active).children().first().attr('src');
switch(network){
case 'facebook':
url='https://www.facebook.com/sharer/sharer.php?picture=' + picture+'&u=' + url + '#id=' + id;
name='Facebook Share';
break;
case 'twitter':
url='http://twitter.com/intent/tweet?text=' + url + '#id=' + id;
name='Twitter Share';
break;
case 'pinterest':
url='http://pinterest.com/pin/create/bookmarklet/?media=' + picture + '&url=' + url + '&is_video=false&description=' + title;
name='Pinterest Share';
break;
}
window.open(url, name, "height=380 ,width=660, resizable=0, toolbar=0, menubar=0, status=0, location=0, scrollbars=0");
}};})(jQuery);
(function($){
'use strict';
function MkfullWidthRow(){
var $windowWidth=$(document).width();
var $elements=$('[data-mk-full-width="true"]');
var direction=$('body.rtl').length ? 'right':'left';
var verticalHeader=$('body.vertical-header-enabled').length ? true:false;
var verticalHeaderWidth=($('.header-style-4 .mk-header-inner').outerWidth() > 270) ? 0:270;
var verticalHeaderRtl=$('body.rtl').length ? -1:1;
var verticalHeaderRtlWidth=$('body.rtl.vertical-header-enabled').length ? verticalHeaderWidth:0;
var verticalHeaderRight=$('body.vertical-header-right').length ? -1:1;
var verticalHeaderWidthBoxed=0;
var boxed=$('body.mk-boxed-enabled').length;
var boxedOffset=(boxed) ?($(window).width() - $('#theme-page').outerWidth()) / 2:0;
var boxedMaxWidth=(boxed) ? $('#theme-page').outerWidth():'auto';
if(verticalHeader&&boxed){
verticalHeaderWidthBoxed=($('.header-style-4 .mk-header-inner').outerWidth() > 270) ? 0:verticalHeaderRtl * verticalHeaderRight * 135;
}
var transparentHeader=$('.transparent-header').length;
if(transparentHeader > 0){
verticalHeaderWidthBoxed=0;
}
$.each($elements, function(key, item){
var $el=$(this);
var css;
$el.addClass("vc_hidden");
var $el_full=$el.next(".vc_row-full-width");
if($el_full.length||($el_full=$el.parent().next(".vc_row-full-width")), $el_full.length){
var el_margin_left=parseInt($el.css("margin-left"), 10),
el_margin_right=parseInt($el.css("margin-right"), 10),
offset=0 - $el_full.offset().left - el_margin_left,
width=$(window).width();
if(css={
position: "relative",
"box-sizing": "border-box",
width: $(window).width(),
maxWidth: boxedMaxWidth
},
css[direction]=offset + boxedOffset + verticalHeaderWidthBoxed +(verticalHeaderRight * verticalHeaderRtlWidth),
$el.css(css), !$el.data("mkStretchContent")){
var padding=-1 * offset;
0 > padding&&(padding=0);
var paddingRight=width - padding - $el_full.width() + el_margin_left + el_margin_right;
padding=padding - paddingRight;
if(0 > paddingRight&&(paddingRight=0)){
css={};
if('right'===direction){
css["padding-left"]=padding + "px";
css["padding-right"]=0;
}else{
css["padding-right"]=padding + "px";
css["padding-left"]=0;
}
$el.css(css)
}}
if(verticalHeader&&! boxed&&! transparentHeader&&! css.hasOwnProperty('padding-left')&&! css.hasOwnProperty('padding-right')){
var side='left';
if(verticalHeaderRight===-1){
side='right';
}
var el_padding_dir=parseInt($el.css('padding-' + side), 10);
var header_padding_dir=$('.header-style-4 .mk-header-inner').outerWidth();
if(el_padding_dir!=header_padding_dir){
if($windowWidth > mk_responsive_nav_width){
$el[0].style.setProperty('padding-' + side, header_padding_dir + 'px', 'important');
}else{
$el[0].style.removeProperty('padding-' + side);
}
var $el_page_section=$el.find('.mk-page-section.full_layout');
if($el_page_section.length > 0){
$el_page_section[0].style.setProperty('padding-' + side, 'unset', 'important');
}}
}
$el.attr("data-mk-full-width-init", "true"), $el.removeClass("vc_hidden"), $(document).trigger("vc-full-width-row-single", {
el: $el,
offset: offset,
marginLeft: el_margin_left,
marginRight: el_margin_right,
elFull: $el_full,
width: width
})
}}), $(document).trigger("mk-full-width-row", $elements);
}
MkfullWidthRow();
var debounceResize=null;
$(window).on("resize", function(){
if(debounceResize!==null){ clearTimeout(debounceResize); }
debounceResize=setTimeout(MkfullWidthRow, 100);
});
})(jQuery);
(function($){
'use strict';
MK.component.Grid=function(el){
var $container=$(el);
var config=$container.data('grid-config');
var isSlideshow=$container.closest('[data-mk-component="SwipeSlideshow"]').length;
var miniGridConfig={
container: el,
item: config.item + ':not(.is-hidden)',
gutter: 0
};
var init=function init(){
if(isSlideshow) return;
MK.core.loadDependencies([ MK.core.path.plugins + 'minigrid.js' ], create);
};
var prepareForGrid=function prepareForGrid(){
var $item=$(this);
var isHidden=($item.css('display')==='none');
if(isHidden) $item.addClass('is-hidden');
else $item.removeClass('is-hidden');
};
var create=function create(){
var timer=null;
function draw(){
$container.find(config.item).each(prepareForGrid);
minigrid(miniGridConfig);
}
function redraw(){
if(timer) clearTimeout(timer);
timer=setTimeout(draw, 100);
}
draw();
$(window).off('resize', redraw);
$(window).on('resize', redraw);
MK.utils.eventManager.subscribe('item-expanded', redraw);
MK.utils.eventManager.subscribe('ajaxLoaded', redraw);
MK.utils.eventManager.subscribe('staticFilter', redraw);
};
return {
init:init
};};
})(jQuery);
(function ($){
'use strict';
var families=[
['awesome-icons' , 'mk-icon-'],
['icomoon' , 'mk-moon-'],
['pe-line-icons' , 'mk-li-'],
['theme-icons' , 'mk-jupiter-icon-']
];
var extend={
'awesome-icons':[],
'icomoon':[],
'pe-line-icons':[],
'theme-icons':[]
};
var _cache={};
var _cacheId=0;
var _config=[];
var _roundCount=0;
var _iconMap={};
var getIconsSprite=(function(){
var $icons=null;
var iterator=0;
function run(callback){
var config=encodeURIComponent(JSON.stringify(_config));
$.ajax({
url:MK.core.path.ajaxUrl,
method: 'POST',
data: {action:'mk_get_icon', iterator: iterator++, config: config},
success: function(sprite){
callback(sprite, $icons);
_config=[];
_iconMap={};
$icons=null;
},
error: function(err){
console.log('Icon load problem');
}});
}
return function(callback, $els, count){
if(!$icons) $icons=$els;
else $icons.add($els);
if(!count) run(callback);
};}());
$(window).on('load', function(){
setTimeout(function(){
createAll(document);
if($('.mk-header').length) createAll('.mk-header');
if($('.js-flexslider, .mk-flexslider').length) createAll('.js-flexslider, .mk-flexslider');
if($('.mk-accordion').length) createAll('.mk-accordion');
}, 1000);
});
MK.utils.eventManager.subscribe('ajaxLoaded', function(){
setTimeout(createAll, 100, '.js-loop');
});
MK.utils.eventManager.subscribe('ajax-preview', function(){
setTimeout(createAll, 100, '.ajax-container');
});
MK.utils.eventManager.subscribe('photoAlbum-open', function(){
setTimeout(createAll, 100, '.gallery-share');
});
MK.utils.eventManager.subscribe('quickViewOpen', function(){
setTimeout(createAll, 300, '.mk-modal-content');
});
function createAll(scope){
for(var i=0, l=families.length; i < l; i++){
var family=families[i][0];
var prefix=families[i][1];
var $icons=getIcons(family, prefix, scope);
if($icons.length){
_roundCount++;
setTimeout(createIcons, 0, $icons, family, prefix);
}}
}
function getIcons(family, prefix, scope){
var $scope=$(scope);
var $icons=$scope.find('[class*='+ prefix +']');
var extraClassNames=extend[family];
if(!extraClassNames) return $icons;
extraClassNames.forEach(function(className){
var $icon=$scope.find(className);
$icons=$icons.add($icon);
});
return $icons;
}
function createIcons($icons, family, prefix, i, unicode){
var id=i||0;
var icon=$icons[id];
if(!icon){
_roundCount--;
getIconsSprite(insertIcons, $icons, _roundCount, _config);
return;
}
var css=getComputedStyle(icon, ':before');
var classAttr=icon.getAttribute('class');
var name=(classAttr) ? matchClass(classAttr.split(' '), prefix):false;
var h=getComputedStyle(icon).fontSize;
var config=createConfig(css, name, family, unicode, h);
var cache=JSON.stringify(config);
if(!config){
}else if(_cache[cache]){
if(typeof _iconMap[cache]==='undefined') _iconMap[cache]=[$icons.eq(id)];
else _iconMap[cache].push($icons.eq(id));
}else{
if(typeof _iconMap[cache]==='undefined') _iconMap[cache]=[$icons.eq(id)];
else _iconMap[cache].push($icons.eq(id));
_cache[cache]=_cacheId.toString();
config.id=_cacheId;
_config.push(config);
_cacheId++;
}
createIcons($icons, family, prefix, ++id);
}
function insertIcons(sprite, $icons){
var $sprite=$(sprite);
var $svgs=$sprite.find('svg');
var idMap=invert(_cache);
$sprite.each(function(){
var $svg=$(this);
var id=$svg.attr('data-cacheid');
var configKey=idMap[id];
_cache[configKey]=this;
});
Object.keys(_iconMap).forEach(function (cacheKey){
_iconMap[cacheKey].forEach(function($icons){
$icons.each(function(){
var $svg=$(_cache[cacheKey]).clone();
var $icon=$(this);
function remove(){
if($icon.parents('.pricing-features')) return;
$icon.not('.mk-jupiter-icon-xing')
.not('.mk-jupiter-icon-square-xing')
.not('.mk-jupiter-icon-simple-xing')
.find('.mk-svg-icon')
.not('[data-name="mk-moon-zoom-in"]')
.remove();
}
if($svg.length) remove();
if(!$icon.find('svg').length){
if($icon.parents('.widget ul').length) $icon.prepend($svg);
else $icon.append($svg);
}});
});
});
MK.utils.eventManager.publish('iconsInsert');
}
function createConfig(css, name, family, unicode, height){
var hasGradient=checkGradient(css);
var hasDirection=extractGradient('direction', css.background);
var config={
family: family,
unicode: (unicode) ? unicode:decodeUnicode(css.content),
name: name,
gradient_type: hasGradient ? extractGradient('type' , css.background):false,
gradient_start: hasGradient ? extractGradient('start', css.background):false,
gradient_stop: hasGradient ? extractGradient('stop' , css.background):false,
gradient_direction: hasDirection ? extractGradient('direction', css.background).replace(' ', '-'):false,
height: height
};
if(!config.name&&!config.unicode) return false;
else return config;
}
function matchClass(classes, prefix){
for(var i=0, l=classes.length; i < l; i++){
if(classes[i].indexOf(prefix)!==-1) return classes[i];
}}
function checkGradient(css){
var bg=css.background;
if(bg.indexOf('radial')!==-1||bg.indexOf('linear')!==-1) return bg;
else return false;
}
function extractGradient(attr, grad){
if(!grad) return false;
var isRadial=grad.indexOf('radial')!==-1;
var isLinear=grad.indexOf('linear')!==-1;
var hasDirection=grad.indexOf('(to')!==-1;
var f, t;
if(attr==='type'){
if(isRadial) return 'radial';
if(isLinear) return 'linear';
}else if(attr==='start'){
f=getStrPosition(grad, 'rgb(', 1);
t=getStrPosition(grad, '0%' , 1);
}else if(attr==='stop'){
f=getStrPosition(grad, 'rgb(', 2);
t=getStrPosition(grad, '100%', 1);
}else if(attr==='direction'){
if(!hasDirection) return false;
f=getStrPosition(grad, '(to', 1) + 4;
t=getStrPosition(grad, ', rgb(', 1);
}else{
return false;
}
return grad.slice(f, t);
}
function getStrPosition(str, m, i){
return str.split(m, i).join(m).length;
}
function decodeUnicode(content){
if(content&&content!=='none') return escape(content).replace(/%22/g, '').replace('%u', '').toLowerCase();
else return false;
}
function invert(obj){
var new_obj={};
for (var prop in obj){
if(obj.hasOwnProperty(prop)){
new_obj[obj[prop]]=prop;
}}
return new_obj;
}}(jQuery));
!function(t,e){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",e):"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}("undefined"!=typeof window?window:this,function(){function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var i=this._events=this._events||{},n=i[t]=i[t]||[];return-1==n.indexOf(e)&&n.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var i=this._onceEvents=this._onceEvents||{},n=i[t]=i[t]||{};return n[e]=!0,this}},e.off=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=i.indexOf(e);return-1!=n&&i.splice(n,1),this}},e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=0,o=i[n];e=e||[];for(var r=this._onceEvents&&this._onceEvents[t];o;){var s=r&&r[o];s&&(this.off(t,o),delete r[o]),o.apply(this,e),n+=s?0:1,o=i[n]}return this}},t}),function(t,e){"use strict";"function"==typeof define&&define.amd?define(["ev-emitter/ev-emitter"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("ev-emitter")):t.imagesLoaded=e(t,t.EvEmitter)}(window,function(t,e){function i(t,e){for(var i in e)t[i]=e[i];return t}function n(t){var e=[];if(Array.isArray(t))e=t;else if("number"==typeof t.length)for(var i=0;i scrollCheckPoint())&&!ajaxLoader.isLoading) loadMore();
}
function loadMore(){
loadingIndicatorStart();
var page=ajaxLoader.getData('paged');
ajaxLoader.setData({paged: ++page});
ajaxLoader.load(unique);
}
function onLoad(e, response){
if(typeof response!=='undefined'&&response.id===id){
if(ajaxLoader.getData('found_posts') <=0&&ajaxLoader.getData('paged') >=ajaxLoader.getData('maxPages')) loadingIndicatorHide();
else loadingIndicatorShow();
if(response.unique===unique) $container.append(response.content);
loadingIndicatorStop();
}}
function loadingIndicatorStart(){
if(isLoadBtn) $loadBtn.addClass('is-active');
else if(isInfiniteScroll) MK.ui.loader.add('.js-load-more-scroll');
}
function loadingIndicatorStop(){
if(isLoadBtn) $loadBtn.removeClass('is-active');
else if(isInfiniteScroll) MK.ui.loader.remove('.js-load-more-scroll');
}
function loadingIndicatorShow(){
if(isHandlerBinded) return;
if(isLoadBtn) $loadBtn.show();
else if(isInfiniteScroll) $loadScroll.show();
bindHandlers();
}
function loadingIndicatorHide(){
if(!isHandlerBinded) return;
if(isLoadBtn) $loadBtn.hide();
else if(isInfiniteScroll) $loadScroll.hide();
unbindHandlers();
}
function spyScrollCheckPoint(){
var containerO=0;
var containerH=dynamicHeight($superContainer);
var winH=dynamicHeight(window);
var setVals=function(){
containerO=$superContainer.offset().top;
};
setVals();
$window.on('resize', function(){ requestAnimationFrame(setVals); });
return function(){
return (containerH() + containerO) - (winH() * 2);
};}}
})(jQuery, window);
(function($){
'use strict';
function isHidden(el){
return (el.offsetParent===null);
}
MK.component.Masonry=function(el){
var $window=$(window);
var $container=$(el);
var config=$container.data('masonry-config');
var $masonryItems=$container.find(config.item);
var cols=config.cols||8;
var $filterItems=null;
var wall=null;
var init=function init(){
MK.core.loadDependencies([ MK.core.path.plugins + 'freewall.js' ], onDepLoad);
};
var onDepLoad=function onDepLoad(){
masonry();
$window.on('resize', onResize);
MK.utils.eventManager.subscribe('ajaxLoaded', onPostAddition);
MK.utils.eventManager.subscribe('staticFilter', resize);
};
var masonry=function masonry(){
if(isHidden(el)) return;
var newCols;
if(window.matchMedia('(max-width:600px)').matches) newCols=2;
else if(window.matchMedia('(max-width:850px)').matches) newCols=4;
else newCols=cols;
var colW=$container.width() / newCols;
wall=new Freewall(config.container);
wall.reset({
selector: config.item + ':not(.is-hidden)',
gutterX: 0,
gutterY: 0,
cellW: colW,
cellH: colW
});
wall.fillHoles();
wall.fitWidth();
$masonryItems.each(function(){
$(this).data('loaded', true);
});
};
var destroyContainer=function destroyContainer(){
$container.removeAttr('style')
.removeData('wall-height')
.removeData('wall-width')
.removeData('min-width')
.removeData('total-col')
.removeData('total-row')
.removeAttr('data-wall-height')
.removeAttr('data-wall-width')
.removeAttr('data-min-width')
.removeAttr('data-total-col')
.removeAttr('data-total-row');
};
var destroyItem=function destroyItem(){
var $item=$(this);
$item.removeAttr('style')
.removeData('delay')
.removeData('height')
.removeData('width')
.removeData('state')
.removeAttr('data-delay')
.removeAttr('data-height')
.removeAttr('data-width')
.removeAttr('data-state');
};
var destroyAll=function destroyAll(){
if(!wall) return;
wall.destroy();
destroyContainer();
$masonryItems.each(destroyItem);
};
var onResize=function onResize(){
requestAnimationFrame(resize);
};
var refresh=function refresh(){
if(!wall) return;
setTimeout(wall.fitWidth.bind(wall), 5);
};
var resize=function resize(){
destroyAll();
masonry();
};
var onPostAddition=function onPostAddition(){
$masonryItems=$container.find(config.item);
$masonryItems.each(function(){
var $item=$(this),
isLoaded=$item.data('loaded');
if(!isLoaded) $item.css('visibility', 'hidden');
});
$container.mk_imagesLoaded().then(function(){
destroyAll();
masonry();
});
};
return {
init:init
};};
}(jQuery));
(function($){
'use strict';
var val=MK.val,
utils=MK.utils;
MK.component.Parallax=function(el){
var self=this,
$this=$(el),
obj=$this[0],
$window=$(window),
container=document.getElementById('mk-theme-container'),
config=$this.data('parallax-config'),
$holder=$(config.holder),
headerHeight=null,
offset=null,
elHeight=null,
ticking=false,
isMobile=null;
var clientRect=null;
var update=function(){
obj.style.transform=null;
obj.style.top=null;
obj.style.bottom=null;
isMobile=MK.utils.isMobile();
if(isMobile){
$this.css('height', '');
return;
}
clientRect=$this[ 0 ].getBoundingClientRect();
offset=clientRect.top;
elHeight=clientRect.height;
headerHeight=val.offsetHeaderHeight(offset);
offset=offset - headerHeight + val.scroll();
setPosition();
setSize();
};
var h=0,
winH=0,
proportion=0,
height=0;
var setSize=function(){
$this.css('height', '');
winH=$window.height() - headerHeight;
h=obj.getBoundingClientRect().height;
if(config.speed <=1&&config.speed > 0){
if(offset===0){
$this.css({
backgroundAttachment: 'scroll',
'will-change': 'transform'
});
}else{
$this.css({
height:h +((winH - h) * config.speed),
backgroundAttachment: 'scroll',
'will-change': 'transform'
});
}}else if(config.speed > 1&&h <=winH){
$this.css({
height:(winH +(( winH * config.speed) - winH) * 2),
top: -(( winH * config.speed) - winH),
backgroundAttachment: 'scroll',
'will-change': 'transform'
});
}else if(config.speed > 1&&h > winH){
proportion=h / winH;
height=(winH +(( winH * config.speed) - winH) * (1 + proportion));
$this.css({
height: height,
top: -(height - (winH * config.speed)),
backgroundAttachment: 'scroll',
'will-change': 'transform'
});
}else if(config.speed < 0&&h >=winH){
height=h * (1 - config.speed);
$this.css({
height: height + (height - h),
top: h - height,
backgroundAttachment: 'scroll',
'will-change': 'transform'
});
}else if(config.speed < 0&&h < winH){
var display=(winH + h) / winH;
height=h * -config.speed * display;
$this.css({
height: h + (height * 2),
top: -height,
backgroundAttachment: 'scroll',
'will-change': 'transform'
});
}};
var currentPoint=null,
progressVal=null,
startPoint=null,
endPoint=null,
$opacityLayer=config.opacity ? $this.find(config.opacity):null,
scrollY=null;
var setPosition=function(){
startPoint=offset - winH;
endPoint=offset + elHeight + winH - headerHeight;
scrollY=val.scroll();
if(scrollY < startPoint||scrollY > endPoint){
ticking=false;
return;
}
currentPoint=((-offset + scrollY) * config.speed);
$this.css({
'-webkit-transform': 'translateY(' + currentPoint + 'px) translateZ(0)',
'-moz-transform': 'translateY(' + currentPoint + 'px) translateZ(0)',
'-ms-transform': 'translateY(' + currentPoint + 'px) translateZ(0)',
'-o-transform': 'translateY(' + currentPoint + 'px) translateZ(0)',
'transform': 'translateY(' + currentPoint + 'px) translateZ(0)'
});
ticking=false;
};
var requestTick=function(){
if(!ticking&&!isMobile){
ticking=true;
window.requestAnimationFrame(setPosition);
}};
var init=function(){
if(!MK.utils.isSmoothScroll){ return; }
update();
setTimeout(update, 100);
$window.on('load', update);
$window.on('resize', update);
window.addResizeListener(container, update);
$window.on('scroll', requestTick);
};
return {
init:init
};};
})(jQuery);
(function($){
'use strict';
MK.component.Pagination=function(el){
this.el=el;
};
MK.component.Pagination.prototype={
init: function init(){
this.cacheElements();
this.bindEvents();
this.onInitLoad();
},
cacheElements: function cacheElements(){
this.lastId=1;
this.unique=Date.now();
this.$pagination=$(this.el);
this.$container=this.$pagination.prev('.js-loop');
this.$pageLinks=this.$pagination.find('.js-pagination-page');
this.$nextLink=this.$pagination.find('.js-pagination-next');
this.$prevLink=this.$pagination.find('.js-pagination-prev');
this.$current=this.$pagination.find('.js-current-page');
this.$maxPages=this.$pagination.find('.pagination-max-pages');
this.containerId='#' + this.$container.attr('id');
this.pagePathname=window.location.pathname;
this.pageSearch=window.location.search;
this.popState=false;
this.ajaxLoader=new MK.utils.ajaxLoader('#' + this.$container.attr('id'));
this.ajaxLoader.init();
},
bindEvents: function bindEvents(){
this.$pageLinks.on('click', this.pageClick.bind(this));
this.$nextLink.on('click', this.nextClick.bind(this));
this.$prevLink.on('click', this.prevClick.bind(this));
MK.utils.eventManager.subscribe('ajaxLoaded', this.onLoad.bind(this));
},
pageClick: function pageClick(e){
e.preventDefault();
var $this=$(e.currentTarget);
var id=parseFloat($this.attr('data-page-id'));
if(id > this.ajaxLoader.getData('maxPages')||id < 1) return;
this.load(id, $this);
this.updatePagedNumUrl(id);
},
nextClick: function nextClick(e){
e.preventDefault();
if(this.ajaxLoader.getData('paged')===this.ajaxLoader.getData('maxPages')) return;
this.load(++this.lastId, $(e.currentTarget));
this.updatePagedNumUrl(this.lastId);
},
prevClick: function prevClick(e){
e.preventDefault();
if(this.ajaxLoader.getData('paged')===1) return;
this.load(--this.lastId, $(e.currentTarget));
this.updatePagedNumUrl(this.lastId);
},
load: function load(id, $el){
this.lastId=id;
this.ajaxLoader.setData({paged: id});
this.ajaxLoader.load(this.unique);
this.removeIndicator();
MK.ui.loader.add($el);
},
onLoad: function success(e, response){
if(typeof response!=='undefined'&&response.id===this.containerId){
this.updatePagination();
this.lastId=this.ajaxLoader.getData('paged');
if(response.unique===this.unique){
this.removeIndicator();
this.scrollPage();
this.$container.html(response.content);
}}
},
updatePagination: function updatePagination(){
var self=this;
var isFirst=(this.ajaxLoader.getData('paged')===1);
var isLast=(this.ajaxLoader.getData('paged')===this.ajaxLoader.getData('maxPages'));
if(isFirst) this.$prevLink.addClass('is-vis-hidden');
else this.$prevLink.removeClass('is-vis-hidden');
if(isLast) this.$nextLink.addClass('is-vis-hidden');
else this.$nextLink.removeClass('is-vis-hidden');
this.$current.html(this.ajaxLoader.getData('paged'));
this.$maxPages.html(this.ajaxLoader.getData('maxPages'));
var displayItems=10;
var centerAt=displayItems / 2;
if(this.ajaxLoader.getData('maxPages') > displayItems){
this.$pageLinks.each(function(i){
var id=self.lastId - centerAt;
id=Math.max(id, 1);
id=Math.min(id, self.ajaxLoader.getData('maxPages') - displayItems + 1);
id=id + i;
$(this).html(id).attr('data-page-id', id).show();
if(i===0&&id > 1) $(this).html('...');
if(i===displayItems - 1&&id < self.ajaxLoader.getData('maxPages')) $(this).html('...');
});
}else{
this.$pageLinks.each(function(i){
var $link=$(this);
var id=i + 1;
$link.html(id).attr('data-page-id', id);
if(self.ajaxLoader.getData('maxPages')===1){
self.$pageLinks.hide();
}else{
if(i > self.ajaxLoader.getData('maxPages') - 1) $link.hide();
else $link.show();
}});
}
this.$pageLinks.filter('[data-page-id="' + this.ajaxLoader.getData('paged') + '"]').addClass('current-page')
.siblings().removeClass('current-page');
},
scrollPage: function scrollPage(){
var containerOffset=this.$container.offset().top;
var offset=containerOffset - MK.val.offsetHeaderHeight(containerOffset) - 20;
MK.utils.scrollTo(offset);
},
removeIndicator: function removeIndicator(){
MK.ui.loader.remove('.js-pagination-page, .js-pagination-next, .js-pagination-prev');
},
onInitLoad: function onInitLoad(){
var initPagedID=this.$pagination.data('init-pagination');
if(initPagedID&&initPagedID > 1){
this.$current.html(initPagedID);
this.$pageLinks.filter('[data-page-id="' + initPagedID + '"]').addClass('current-page').siblings().removeClass('current-page');
}
if('onpopstate' in window){
var thisPop=this;
window.onpopstate=function(event){
var id=1;
if(typeof event.state==='object'&&event.state){
var state=event.state;
if(state.hasOwnProperty('MkPagination')){
var currentState=state.MkPagination;
if(currentState.hasOwnProperty('paged')){
id=parseFloat(currentState.paged);
}}
}else{
id=parseFloat(thisPop.getURLPagedID());
}
thisPop.popState=true;
thisPop.$pageLinks.filter('[data-page-id="' + id + '"]').trigger('click');
}}
},
updatePagedNumUrl: function updatePagedNumUrl(id){
if('history' in window&&'pushState' in history&&id&&! this.popState){
var fullPage=this.pagePathname + this.pageSearch;
var isQueryPage=false;
var newPage='page/' + id + '/';
var expPage=/page\/\d+\/?/;
var result=this.pagePathname.match(/\/page\/\d+/);
var isPagedExist=(result) ? true:false;
if(! isPagedExist&&this.pageSearch){
isQueryPage=this.pageSearch.match(/page\=\d+/);
if(isQueryPage){
newPage='page=' + id;
expPage=/page\=\d+/;
}}
if(id===1){
newPage='';
if(isQueryPage){
expPage=(this.pageSearch.match(/\&+/)) ? /page\=\d+\&?/:/\?page\=\d+\&?/;
}}
var newURL=this.pagePathname + newPage + this.pageSearch;
if(fullPage.match(expPage)){
newURL=fullPage.replace(expPage, newPage);
}
var historyState={
MkPagination: {
url: newURL,
paged: id
}}
this.popState=false;
window.history.pushState(historyState, null, newURL);
}
this.popState=false;
},
getURLPagedID: function getURLPagedID(){
var pathname=window.location.pathname;
var search=window.location.search;
var pagedId=1;
var result='';
var isPagedExist=false;
result=pathname.match(/\/page\/(\d+)/);
if(result){
isPagedExist=true;
pagedId=(result.hasOwnProperty(1)) ? result[1]:1;
}
if(! isPagedExist&&search){
result=search.match(/page\=(\d+)/);
if(result){
isPagedExist=true;
pagedId=(result.hasOwnProperty(1)) ? result[1]:1;
}}
return pagedId;
}};}(jQuery));
(function($){
'use strict';
MK.component.Preloader=function(el){
this.el=el;
};
MK.component.Preloader.prototype={
init: function init(){
this.cacheElements();
this.bindEvents();
},
cacheElements: function cacheElements(){
this.$preloader=$(this.el);
},
bindEvents: function bindEvents(){
this.onLoad();
},
onLoad: function onLoad(){
setTimeout(this.hidePreloader.bind(this), 300);
},
hidePreloader: function hidePreloader(){
this.$preloader.hide();
}};}(jQuery));
(function($){
'use strict';
MK.ui.loader={
tpl:function(){
return '' +
'
' +
'
' +
'
' +
'
' +
'
';
},
add:function(item){
$(item).append(this.tpl);
},
remove:function(item){
if(item) $(item).find('.mk-loading-indicator').remove();
else $('.mk-loading-indicator').remove();
}};}(jQuery));
(function($){
if(MK.utils.browser.name==='Edge'||MK.utils.browser.name==='IE'){
var val=1;
var $edgeClipper=$('.mk-slider-slide');
var $sectionClipper=$('.clipper-true');
var $bgLayer=$('.background-layer');
var onScroll=function onScroll(){
val *=-1;
if($edgeClipper.length) $edgeClipper.each(redraw);
if($sectionClipper.length) $sectionClipper.each(redraw);
if($bgLayer.length) $bgLayer.each(redraw);
};
var redraw=function redraw(){
$(this).css('margin-top', val / 100);
};
$(window).on("scroll", function (){
window.requestAnimationFrame(onScroll);
});
}}(jQuery));
MK.component.ResponsiveImageSetter=(function ($){
'use strict';
var module={};
var viewportClass=getViewportClass();
var isRetina=window.devicePixelRatio >=2;
function run($imgs){
$imgs.filter(function(){
return !this.hasAttribute("mk-img-src-setted");
}).each(setSrcAttr);
}
function setSrcAttr(){
var $img=$(this);
var set=$img.data('mk-image-src-set');
if(set['responsive']==='false'&&isRetina&&set['2x']) $img.attr('src', set['2x']);
else if(set['responsive']==='false') $img.attr('src', set.default);
else if(viewportClass===1&&isRetina&&set['2x']) $img.attr('src', set['2x']);
else if(viewportClass===0&&set.mobile) $img.attr('src', set.mobile);
else $img.attr('src', set.default);
$img.load(function(){
$(window).trigger('mk-image-loaded')
})
}
function getViewportClass(){
if(window.matchMedia('(max-width: 736px)').matches) return 0;
else return 1;
}
function handleResize($imgs){
if(!$imgs.length) return;
var currentViewportClass=getViewportClass();
if(currentViewportClass > viewportClass){
viewportClass=currentViewportClass;
run($imgs);
}}
module.init=function ($imgs){
if(!$imgs.length) return;
run($imgs);
$imgs.attr('mk-img-src-setted', '');
};
module.onResize=function ($imgs){
$(window).on('resize', MK.utils.throttle(500, function(){
handleResize($imgs);
}));
};
module.handleAjax=function (){
setTimeout(function ajaxDelayedCallback(){
var $newImgs=$('img[data-mk-image-src-set]').filter(function(){
return !this.hasAttribute("mk-lazyload");
});
if(!$newImgs.length) return;
run($newImgs);
}, 100);
}
return module;
}(jQuery));
jQuery(function($){
var init=function init(){
$allImages=$('img[data-mk-image-src-set]').filter(function(index){
var isNotPortfolioImage = !$(this).hasClass('portfolio-image'),
isNotBlogImage=$(this).closest('.mk-blog-container').length==0,
isNotSwiperImage = !$(this).hasClass('swiper-slide-image'),
isNotGalleryImage = !$(this).hasClass('mk-gallery-image');
return isNotPortfolioImage&&isNotBlogImage&&isNotSwiperImage&&isNotGalleryImage;
});;
MK.component.ResponsiveImageSetter.onResize($allImages);
MK.component.ResponsiveImageSetter.init($allImages);
MK.utils.eventManager.subscribe('ajaxLoaded', MK.component.ResponsiveImageSetter.handleAjax);
MK.utils.eventManager.subscribe('ajax-preview', MK.component.ResponsiveImageSetter.handleAjax);
MK.utils.eventManager.subscribe('quickViewOpen', MK.component.ResponsiveImageSetter.handleAjax);
}
init();
$(window).on('vc_reload', init);
});
(function($){
'use strict';
var utils=MK.utils;
var val=MK.val;
var $topLevelSections=$('#theme-page > .vc_row, #theme-page > .mk-main-wrapper-holder, #theme-page > .mk-page-section');
$(document).on('click', '.mk-skip-to-next', function(){
var $this=$(this),
btnHeight=$this.hasClass('edge-skip-slider') ? 150:76,
offset=$this.offset().top + btnHeight,
nextOffset=utils.nextHigherVal(utils.offsets($topLevelSections), [offset]);
utils.scrollTo(nextOffset - val.offsetHeaderHeight(nextOffset));
});
})(jQuery);
(function($){
'use strict';
MK.ui.Slider=function(container, config){
var defaults={
slide:'.mk-slider-slide',
nav:'.mk-slider-nav',
effect:'roulete',
ease:'easeOutQuart',
slidesPerView:1,
slidesToView:1,
transitionTime:700,
displayTime:3000,
autoplay:true,
hasNav:true,
hasPagination:true,
paginationTpl:' ',
paginationEl:'#pagination',
draggable:true,
fluidHeight:false,
pauseOnHover:false,
lazyload:false,
activeClass:'is-active',
edgeSlider:false,
spinnerTpl:'',
onInitialize:function(){},
onAfterSlide:function(id){},
onBeforeSlide:function(id){}};
this.state={
id:0,
moveForward:true,
running:false,
zIFlow:null,
stop:false,
};
this.config=$.extend(defaults, config);
this.container=container;
this.initPerView=this.config.slidesPerView;
this.activeTimer=null;
this.autoplay=null;
this.timer=null;
this.timerRemaining=parseInt(this.config.displayTime);
this.config.lazyload=JSON.parse(this.config.lazyload);
this.config.edgeSlider=JSON.parse(this.config.edgeSlider);
this.imageLoader=null;
imagesLoaded.prototype.abort=function(){
this.progress=this.complete=function(){ };};
};
MK.ui.Slider.prototype={
init:function(){
this.setPerViewItems();
this.cacheElements();
this.getSlideSize();
this.bindEvents();
this.setSize();
this.setPos();
this.updateId(-1);
this.updateId(1);
this.val=this.dynamicVal();
this.timeline=this.prepareTimeline(this.config.transitionTime);
this.timeline.build();
if(this.config.hasPagination){ this.buildPagination(); }
if(this.config.autoplay&&document.hasFocus()){ this.setTimer(); }
if(typeof this.config.onInitialize==='function'){
this.config.onInitialize(this.slides);
}
if(this.config.fluidHeight===true){
$(this.slides).height('auto');
$(this.container).css('transition', 'height ' + 200 + 'ms ease-out');
this.setHeight(0);
}
if(this.config.fluidHeight==='toHighest'){
this.setHeightToHighest();
}
$(this.slides).each(this.createTimer);
if(this.config.lazyload&&this.config.edgeSlider){
if($(this.slides[this.state.id]).find('video').length===0){
var $slideImg=$(this.slides[this.state.id]).children('[data-mk-img-set]');
MK.component.BackgroundImageSetter.init($slideImg);
}
$(this.config.spinnerTpl).prependTo(this.$slides);
}else{
MK.component.BackgroundImageSetter.init($(this.slides).children('[data-mk-img-set]'));
}},
cacheElements:function (){
this.container=this.isNode(this.container) ? this.container
: document.querySelectorAll(this.container)[0];
this.slides=this.container.querySelectorAll(this.config.slide);
this.$slides=$(this.slides);
if(this.config.hasNav){ this.$nav=$(this.config.nav); }
if(this.config.hasPagination){ this.$pagination=$(this.config.paginationEl); }},
bindEvents:function(){
var $window=$(window);
if(this.config.slidesPerView > 1){ $window.on('resize', this.setPerViewItems.bind(this)); }
if(this.config.hasNav){ this.eventsNav(); }
if(this.config.hasPagination){ this.eventsPag(); }
if(this.config.draggable){ this.dragHandler(); }
if(this.config.autoplay){
$window.on('focus', this.windowActive.bind(this));
$window.on('blur', this.windowInactive.bind(this));
}
if(this.config.pauseOnHover){
$(this.container).on('mouseleave', this.setTimer.bind(this));
$(this.container).on('mouseenter', this.unsetTimer.bind(this));
}
if(this.config.fluidHeight==='toHighest'){
$window.on('resize', this.setHeightToHighest.bind(this));
}},
setPerViewItems: function(){
if(window.matchMedia('(max-width: 500px)').matches){ this.config.slidesPerView=1; }
else if(window.matchMedia('(max-width: 767px)').matches&&this.initPerView >=2){ this.config.slidesPerView=2; }
else if(window.matchMedia('(max-width: 1024px)').matches&&this.initPerView >=3){ this.config.slidesPerView=3; }else{ this.config.slidesPerView=this.initPerView; }
if(typeof this.slides==='undefined') return;
this.getSlideSize();
this.setSize();
this.setPos();
this.timeline=this.prepareTimeline(this.config.transitionTime);
this.timeline.build();
},
eventsNav:function(){
this.$nav.on('click', 'a', this.handleNav.bind(this));
},
eventsPag:function(){
this.$pagination.on('click', 'a', this.handlePagination.bind(this));
},
handleNav:function(e){
e.preventDefault();
if(this.state.running){ return; }
this.state.running=true;
var $this=$(e.currentTarget),
moveForward=$this.data('direction')==='next';
if(this.config.autoplay){
this.unsetTimer();
setTimeout(this.setTimer.bind(this), this.config.transitionTime);
}
this.state.moveForward=moveForward;
this.timeline.build();
this.timeline.play();
this.setActive(this.nextId(moveForward ? 1:-1));
if(this.config.fluidHeight){ this.setHeight(this.nextId(moveForward ? 1:-1)); }},
handlePagination:function(e){
e.preventDefault();
var $this=$(e.currentTarget),
id=$this.index();
this.goTo(id);
},
reset: function(){
this.state.stop=true;
this.state.id=0;
this.setPos();
this.unsetTimer();
this.setTimer();
},
goTo:function(id){
if(this.state.running){ return; }
this.state.running=true;
var lastId=this.state.id;
if(lastId===id){
return;
}else if(lastId < id){
this.state.moveForward=true;
}else{
this.state.moveForward=false;
}
if(this.config.autoplay){
this.unsetTimer();
setTimeout(this.setTimer.bind(this), this.config.transitionTime);
}
this.timeline.build(Math.abs(lastId - id));
this.timeline.play();
this.setActive(id);
if(this.config.fluidHeight){ this.setHeight(id); }},
windowActive:function(){
this.setTimer(false, true);
$(this.container).removeClass('is-paused');
},
windowInactive:function(){
this.unsetTimer();
$(this.container).addClass('is-paused');
},
updateId:function(val){
this.state.id=this.nextId(val);
},
nextId:function(val){
var len=this.slides.length,
insertVal=this.state.id + val;
insertVal=(insertVal >=0) ? insertVal:len + val;
insertVal=(insertVal >=len) ? 0:insertVal;
return insertVal;
},
setStyle:function(obj, style){
var hasT=style.transform,
t={
x:(hasT) ? style.transform.translateX:null,
y:(hasT) ? style.transform.translateY:null,
scale:(hasT) ? style.transform.scale:null,
rotate:(hasT) ? style.transform.rotate:null,
rotateX:(hasT) ? style.transform.rotateX:null,
rotateY:(hasT) ? style.transform.rotateY:null
},
z='translateZ(0)',
x=(t.x) ? 'translateX(' + t.x + '%)':'translateX(0)',
y=(t.y) ? 'translateY(' + t.y + '%)':'translateY(0)',
s=(t.scale) ? 'scale(' + t.scale + ')':'scale(1)',
r=(t.rotate) ? 'rotate(' + t.rotate + 'deg)':'rotate(0)',
rX=(t.rotateX) ? 'rotateX(' + t.rotateX + 'deg)':'',
rY=(t.rotateY) ? 'rotateY(' + t.rotateY + 'deg)':'',
o=style.opacity,
h=style.height,
w=style.width;
var c=z + x + y + s + r + rX + rY;
if(c.length){
obj.style.webkitTransform=c;
obj.style.msTransform=c;
obj.style.transform=c;
}
if(typeof o==='number'){ obj.style.opacity=o; }
if(h){ obj.style.height=h + '%'; }
if(w){ obj.style.width=w + '%'; }},
setPos:function(){
if(typeof this.slides==='undefined') return;
var id=this.state.id,
i=0,
len=this.slides.length,
animation=this.animation[ this.config.effect ],
axis=animation.axis,
animNext=animation.next,
animActi=animation.active,
animPrev=animation.prev,
perView=this.config.slidesPerView,
slideId=null,
zIFlow=null,
style={};
style.transform={};
for(; i < len; i +=1){
if(i < perView){
style=animActi;
style.transform[ 'translate' + axis ]=i * 100;
}else{
style=this.state.moveForward ? animNext:animPrev;
style.transform[ 'translate' + axis ]=this.state.moveForward ? perView * 100:-100;
}
this.slides[ i ].style.zIndex=0;
slideId=(i + id) % len;
this.setStyle(this.slides[ slideId ], style);
}},
setSize:function(){
if(typeof this.slides==='undefined') return;
var i=0,
len=this.slides.length,
axis=this.animation[ this.config.effect ].axis,
slideSize=this.slideSize,
style={};
if(axis==='Y'){
style.height=slideSize[ axis ];
}else{
style.width=slideSize[ axis ];
}
for(; i < len; i +=1){
this.setStyle(this.slides[ i ], style);
}},
setHeight:function(id){
var $slides=$(this.slides),
$activeSlide=$slides.eq(id);
var currentHeight=$activeSlide.height();
$(this.container).height(currentHeight);
},
setHeightToHighest:function(){
var $slides=$(this.slides),
height=0;
$slides.each(function(){
height=Math.max(height, $(this).find('> div').outerHeight());
});
$(this.container).height(height);
},
prepareTimeline:function(time){
var self=this,
iteration=0,
totalIter=time / (1000 / 60),
animLoop=[],
aL=0,
loops=1,
ease=this.config.ease,
currentStyle, timeProg,
build, move, add, play, reverse, progress, kill;
var len=this.slides.length,
perView=this.config.slidesPerView,
animation=this.animation[ this.config.effect ],
animAxis=animation.axis,
animNext=animation.next,
animActi=animation.active,
animPrev=animation.prev,
style={},
slideId=null,
zIFlow=null;
style.transform={};
build=function(repeats){
var currentEase=ease;
loops=repeats||loops;
if(!loops){ return; }
if(loops > 1){
currentEase='linearEase';
}
kill();
self.setPos();
var id=self.state.id,
moveForward=self.state.moveForward,
i=0,
axisMove=(moveForward) ? -100:100;
for(; i <=perView; i +=1){
slideId=((moveForward) ? i + id:i + id - 1) % len;
slideId=(slideId < 0) ? len + slideId:slideId;
if(i===0){
style=moveForward ? animPrev:animActi;
}else if(i===perView){
style=moveForward ? animActi:animNext;
}else{
style=animActi;
}
zIFlow=(self.state.moveForward) ? animNext.zIndex:animPrev.zIndex;
if(zIFlow){
self.slides[ slideId ].style.zIndex=(zIFlow==='+') ? i + 1:len - i;
}
style.transform[ 'translate' + animAxis ]=axisMove;
add(self.slides[ slideId ], style, currentEase);
}};
add=function(slide, toStyles, ease){
if(typeof slide==='undefined'){
throw 'Add at least one slide';
}
var fromStyles=slide.style,
style=self.refStyle(toStyles, fromStyles);
animLoop.push([slide, style, ease]);
aL +=1;
};
move=function(startProg, mode){
if(isTest) return;
var currentTotalIter=totalIter;
if(loops > 1){
currentTotalIter=totalIter / 5;
}
if(!self.state.running){ self.state.running=true; }
if(startProg){
iteration=Math.ceil(startProg * currentTotalIter);
}
timeProg=iteration / currentTotalIter;
progress(timeProg);
if(iteration >=currentTotalIter&&mode==='play' ||
iteration <=0&&mode==='reverse'){
self.state.running=false;
iteration=0;
kill();
self.updateId(self.state.moveForward ? 1:-1);
loops -=1;
if(loops > 0){
build();
play();
}
if(!loops){
loops=1;
self.timerRemaining=parseInt(self.config.displayTime);
self.config.onAfterSlide(self.state.id);
}
return;
}
if(mode==='play'){
iteration +=1;
}else{
iteration -=1;
}
requestAnimationFrame(function(){
if(self.state.stop) return;
move(0, mode);
});
};
play=function(startProg){
var $nextSlide=$(self.slides[ self.nextId(self.state.moveForward ? 1:-1) ]);
if(self.config.lazyload&&self.config.edgeSlider){
var $slideImg=$nextSlide.find('[data-mk-img-set]');
if($slideImg.length){
MK.component.BackgroundImageSetter.init($slideImg);
}}
self.config.onBeforeSlide(self.nextId(self.state.moveForward ? 1:-1));
var start=startProg||0;
iteration=0;
self.state.stop=false;
move(start, 'play');
};
reverse=function(startProg){
var start=startProg||1;
move(start, 'reverse');
};
progress=function(progVal){
var aI=0,
currentStyle;
for(aI; aI < aL; aI++){
if(progVal!==1&&progVal!==0){
currentStyle=self.currentStyle(progVal, animLoop[ aI ][ 1 ], animLoop[ aI ][ 2 ]);
}else if(progVal===1){
currentStyle=self.currentStyle(progVal, animLoop[ aI ][ 1 ], 'linearEase');
}else if(progVal===0){
currentStyle=self.currentStyle(progVal, animLoop[ aI ][ 1 ], 'linearEase');
}
self.setStyle(animLoop[ aI ][ 0 ], currentStyle);
}};
kill=function(){
animLoop=[];
aL=0;
};
return {
build:build,
add:add,
play:play,
reverse:reverse,
progress:progress
};},
refStyle:function(toStyles, fromStyles){
var axis=this.animation[ this.config.effect ].axis,
style={},
initVal, changeVal, endVal, dynamicEnd, styleProp, transProp, transform;
for(styleProp in toStyles){
if(styleProp==='transform'){
transform=this.getTransforms(fromStyles);
style.transform={};
for(transProp in toStyles.transform){
if(transProp==='translateZ'){ continue; }
initVal=transform[ transProp ]||0;
dynamicEnd=(transProp==='translate' + axis) ? initVal:0;
endVal=toStyles.transform[ transProp ] + dynamicEnd;
changeVal=endVal - initVal;
style.transform[ transProp ]=[ initVal, changeVal ];
}}else if(styleProp==='zIndex'){
continue;
}else{
initVal=parseFloat(fromStyles[ styleProp ])||0;
endVal=toStyles[ styleProp ];
changeVal=endVal - initVal;
style[ styleProp ]=[ initVal, changeVal ];
}}
return style;
},
currentStyle:function(progress, style, ease){
var self=this,
currentStyle={},
currentVals, styleProp, transProp, prog;
for(styleProp in style){
if(styleProp==='transform'){
currentStyle.transform={};
for(transProp in style.transform){
if(transProp==='translateZ'){ continue; }
currentVals=style.transform[ transProp ];
currentStyle.transform[ transProp ] =
self.ease[ ease ](progress, currentVals[ 0 ], currentVals[ 1 ], 1);
}}else{
currentVals=style[ styleProp ];
currentStyle[ styleProp ] =
self.ease[ ease ](progress, currentVals[ 0 ], currentVals[ 1 ], 1);
}}
return currentStyle;
},
setActive:function(id){
var $slides=$(this.slides),
className=this.config.activeClass;
$slides.removeClass(className);
if(this.config.hasPagination){
var $pagination=this.$pagination.find('a');
$pagination.removeClass(className);
$pagination.eq(id).addClass(className);
}
if(this.activeTimer){
clearTimeout(this.activeTimer);
if(this.imageLoader){
this.imageLoader.abort();
}}
var self=this;
this.activeTimer=setTimeout(function(){
var $currentSlide=$slides.eq(id);
if(self.config.lazyload&&self.config.edgeSlider){
if($currentSlide.find('.mk-section-video').length&&$currentSlide.children('.mk-video-section-touch').length){
var imgSet=$currentSlide.children('.mk-video-section-touch').data('mk-img-set');
var exactImg=MK.component.BackgroundImageSetter.getImage(imgSet);
var $bgImage=$(' ').attr('src', exactImg);
self.imageLoader=imagesLoaded($bgImage[0], function(instance){
$currentSlide.children('.mk-slider-spinner-wrap').addClass('mk-slider-spinner-wrap-hidden');
setTimeout(function(){
$currentSlide.children('.mk-slider-spinner-wrap').hide();
}, 200);
$currentSlide.addClass(className);
});
}else if($currentSlide.find('.mk-section-video').length&&$currentSlide.children('.mk-video-section-touch').length===0){
$currentSlide.children('.mk-slider-spinner-wrap').addClass('mk-slider-spinner-wrap-hidden');
setTimeout(function(){
$currentSlide.children('.mk-slider-spinner-wrap').hide();
}, 200);
$currentSlide.addClass(className);
}else{
if($currentSlide.children('[data-mk-img-set]').length){
var imgSet=$currentSlide.children('[data-mk-img-set]').data('mk-img-set');
var exactImg=MK.component.BackgroundImageSetter.getImage(imgSet);
var $bgImage=$(' ').attr('src', exactImg);
self.unsetTimer();
self.imageLoader=imagesLoaded($bgImage[0], function(instance){
$currentSlide.children('.mk-slider-spinner-wrap').addClass('mk-slider-spinner-wrap-hidden');
setTimeout(function(){
$currentSlide.children('.mk-slider-spinner-wrap').hide();
}, 200);
self.setTimer(false, false, $currentSlide.data('timer')||Number(self.config.displayTime));
$currentSlide.addClass(className);
});
}else{
$currentSlide.children('.mk-slider-spinner-wrap').addClass('mk-slider-spinner-wrap-hidden');
setTimeout(function(){
$currentSlide.children('.mk-slider-spinner-wrap').hide();
}, 200);
self.setTimer(false, false, $currentSlide.data('timer')||Number(self.config.displayTime));
$currentSlide.addClass(className);
}}
}else{
$currentSlide.addClass(className);
}}, this.config.transitionTime);
},
createTimer:function(){
var $slide=$(this),
video=$slide.find('video').get(0);
if(video){
var interval=setInterval(function(){
if(video.readyState > 0){
$slide.data('timer', (video.duration * 1000));
$slide.attr('data-timer', (video.duration * 1000));
clearInterval(interval);
}}, 100);
}},
setTimer:function(isFirst, isPaused, fixed_time){
var customTimer=this.$slides.eq(this.nextId(this.state.moveForward ? 1:-1)).data('timer'),
trans=parseInt(this.config.transitionTime),
interval=customTimer ? customTimer:parseInt(this.config.displayTime),
timer=interval + trans;
var self=this,
first=isFirst||true,
fixed_time=fixed_time||0,
create, run;
this.timer=true;
this.lastSetTimer=Date.now();
create=function(){
if(self.autoplay){ clearTimeout(self.autoplay); }
if(!self.timer){
return;
}
self.state.moveForward=true;
self.timeline.build();
self.timeline.play();
self.setActive(self.nextId(1));
if(self.config.fluidHeight){ self.setHeight(self.nextId(1)); }
first=false;
self.lastSetTimer=Date.now();
run();
};
run=function(newInterval){
customTimer=self.$slides.eq(self.nextId(self.state.moveForward ? 1:-1)).data('timer');
interval=customTimer ? customTimer:parseInt(self.config.displayTime);
timer=interval + trans;
var time=newInterval||timer;
self.autoplay=setTimeout(create, time);
};
if(fixed_time){
run(fixed_time);
}else if(isPaused){
run(this.timerRemaining);
}else{
run();
}},
unsetTimer:function(){
this.timer=false;
this.lastUnsetTimer=Date.now();
this.timerRemaining -=this.lastUnsetTimer - this.lastSetTimer;
if(this.autoplay){ clearTimeout(this.autoplay); }},
buildPagination:function(){
var i=0,
len=this.slides.length,
tpl='';
for(; i < len; i +=1){
tpl +='' + this.config.paginationTpl + ' ';
}
this.$pagination.html(tpl);
this.setActive(0);
},
getSlideSize:function(){
this.slideSize={
X: 100 / this.config.slidesPerView,
Y: 100 / this.config.slidesPerView
};},
getTransforms:function(style){
var transform=style.transform||style.webkitTransform||style.mozTransform,
regex=/(\w+)\(([^)]*)\)/g,
match,
T={};
if(typeof transform!=='string'){
throw 'Transform prop is not a string.';
}
if(!transform){ return; }
while(match=regex.exec(transform)){
T[ match[ 1 ] ]=parseFloat(match[ 2 ]);
}
return T;
},
isNode:function(o){
return (
typeof Node==="object" ? o instanceof Node :
o&&typeof o==="object"&&typeof o.nodeType==="number"&&typeof o.nodeName==="string"
);
},
dragHandler:function(){
var self=this,
$container=$(this.container),
prevBuild=false,
nextBuild=false,
dragging=false,
buffor=5,
dragStart, dragMove, dragEnd, progress;
progress=function(moveX){
return moveX / self.val.viewportW();
};
dragStart=function(moveX, startX){
};
dragMove=function(moveX){
if(self.state.running) return;
if(moveX < -buffor){
if(!nextBuild){
self.state.moveForward=true;
self.timeline.build();
nextBuild=true;
prevBuild=false;
self.unsetTimer();
}else{
self.timeline.progress(-progress(moveX));
}
dragging=true;
}else if(moveX > buffor){
if(!prevBuild){
self.state.moveForward=false;
self.timeline.build();
prevBuild=true;
nextBuild=false;
self.unsetTimer();
}else{
self.timeline.progress(progress(moveX));
}
dragging=true;
}};
dragEnd=function(moveX){
if(dragging){
var prog=progress(moveX),
absProg=prog < 0 ? -prog:prog;
if(absProg > 0.1){
self.timeline.play(absProg);
self.setActive(self.nextId(prog < 0 ? 1:-1));
if(self.config.fluidHeight){ self.setHeight(self.nextId(prog < 0 ? 1:-1)); }}else{
self.timeline.reverse(absProg);
if(prog < 0){
self.updateId(-1);
}else{
self.updateId(1);
}}
prevBuild=false;
nextBuild=false;
dragging=false;
if(self.config.autoplay){ self.setTimer(false); }}
};
this.drag($container, dragStart, dragMove, dragEnd);
},
drag:function($el, startFn, moveFn, stopFn){
var touchX, touchY, movX, movY, go, evt,
prevent, start, move, stop;
prevent=function(e){
e.preventDefault();
};
start=function(e){
$el.on("mousemove", prevent);
$el.on("touchmove", move);
$el.on("mousemove", move);
evt=(e.type==='touchstart') ? e.originalEvent.touches[0]:e;
touchX=evt.pageX;
if(typeof startFn==='function'){
startFn(movX, touchX);
}};
move=function(e){
evt=(e.type==='touchmove') ? e.originalEvent.touches[0]:e;
movX=evt.pageX - touchX;
if(typeof moveFn==='function'){
moveFn(movX);
}};
stop=function(e){
$el.off("mousemove", prevent);
$el.off("touchmove", move);
$el.off("mousemove", move);
if(typeof stopFn==='function'){
stopFn(movX);
}};
$el.on("touchstart", start);
$el.on("mousedown", start);
$el.on("touchend", stop);
$el.on("touchleave", stop);
$el.on("touchcancel", stop);
$el.on("mouseup", stop);
$el.on("mouseleave", stop);
},
dynamicVal:function(){
var $window=$(window),
update,
getViewportW, viewportW;
update=function(){
viewportW=$window.width();
};
getViewportW=function(){
return viewportW;
};
update();
$window.on('load', update);
$window.on('resize', update);
return {
viewportW:getViewportW
};}};
MK.ui.Slider.prototype.animation={
slide:{
axis:'X',
next:{ transform: {}},
active:{ transform: {}},
prev:{ transform: {}}
},
vertical_slide:{
axis:'Y',
next:{ transform: {}},
active:{ transform: {}},
prev:{ transform: {}}
},
perspective_flip:{
axis:'Y',
next:{
transform: {
rotateX:80
}},
active:{
transform: {
rotateX:0
}},
prev:{
transform: {
rotateX:0
}}
},
zoom:{
axis:'Z',
next: {
opacity:0,
transform:{
scale:0.9
}},
active: {
opacity:1,
transform:{
scale:1
}},
prev: {
opacity:0,
transform:{
scale:1.1
}}
},
fade:{
axis:'Z',
next: {
opacity:0,
transform:{}},
active: {
opacity:1,
transform:{}},
prev: {
opacity:0,
transform:{}}
},
kenburned:{
axis:'Z',
next: {
opacity:0,
transform:{}},
active: {
opacity:1,
transform:{}},
prev: {
opacity:0,
transform:{}}
},
zoom_out:{
axis:'Z',
next: {
zIndex:'+',
opacity:1,
transform:{
translateY:100,
scale:1
}},
active: {
opacity:1,
transform:{
translateY:0,
scale:1
}},
prev: {
zIndex:'+',
opacity:0,
transform:{
translateY:0,
scale:0.5
}}
},
horizontal_curtain:{
axis:'Z',
next: {
zIndex:'+',
transform:{
translateX:100,
}},
active: {
transform:{
translateX:0,
}},
prev: {
zIndex:'+',
transform:{
translateX:-70,
}}
},
roulete:{
axis:'X',
next: {
opacity:0.5,
transform:{
scale:0.5,
rotate:10,
translateY:20
}},
active: {
opacity:1,
transform:{
scale:1,
rotate:0,
translateY:0
}},
prev: {
opacity:0.3,
transform:{
scale:0.5,
rotate:-10,
translateY:20
}}
}};
MK.ui.Slider.prototype.ease={
linearEase:function(currentIteration, startValue, changeInValue, totalIterations){
return changeInValue * currentIteration / totalIterations + startValue;
},
easeInQuad:function(currentIteration, startValue, changeInValue, totalIterations){
return changeInValue * (currentIteration /=totalIterations) * currentIteration + startValue;
},
easeOutQuad:function(currentIteration, startValue, changeInValue, totalIterations){
return -changeInValue * (currentIteration /=totalIterations) * (currentIteration - 2) + startValue;
},
easeInOutQuad:function(currentIteration, startValue, changeInValue, totalIterations){
if((currentIteration /=totalIterations / 2) < 1){
return changeInValue / 2 * currentIteration * currentIteration + startValue;
}
return -changeInValue / 2 * ((--currentIteration) * (currentIteration - 2) - 1) + startValue;
},
easeInCubic:function(currentIteration, startValue, changeInValue, totalIterations){
return changeInValue * Math.pow(currentIteration / totalIterations, 3) + startValue;
},
easeOutCubic:function(currentIteration, startValue, changeInValue, totalIterations){
return changeInValue * (Math.pow(currentIteration / totalIterations - 1, 3) + 1) + startValue;
},
easeInOutCubic:function(currentIteration, startValue, changeInValue, totalIterations){
if((currentIteration /=totalIterations / 2) < 1){
return changeInValue / 2 * Math.pow(currentIteration, 3) + startValue;
}
return changeInValue / 2 * (Math.pow(currentIteration - 2, 3) + 2) + startValue;
},
easeInQuart:function(currentIteration, startValue, changeInValue, totalIterations){
return changeInValue * Math.pow (currentIteration / totalIterations, 4) + startValue;
},
easeOutQuart:function(currentIteration, startValue, changeInValue, totalIterations){
return -changeInValue * (Math.pow(currentIteration / totalIterations - 1, 4) - 1) + startValue;
},
easeInOutQuart:function(currentIteration, startValue, changeInValue, totalIterations){
if((currentIteration /=totalIterations / 2) < 1){
return changeInValue / 2 * Math.pow(currentIteration, 4) + startValue;
}
return -changeInValue/2 * (Math.pow(currentIteration - 2, 4) - 2) + startValue;
},
easeInQuint:function(currentIteration, startValue, changeInValue, totalIterations){
return changeInValue * Math.pow (currentIteration / totalIterations, 5) + startValue;
},
easeOutQuint:function(currentIteration, startValue, changeInValue, totalIterations){
return changeInValue * (Math.pow(currentIteration / totalIterations - 1, 5) + 1) + startValue;
},
easeInOutQuint:function(currentIteration, startValue, changeInValue, totalIterations){
if((currentIteration /=totalIterations / 2) < 1){
return changeInValue / 2 * Math.pow(currentIteration, 5) + startValue;
}
return changeInValue / 2 * (Math.pow(currentIteration - 2, 5) + 2) + startValue;
},
easeInSine:function(currentIteration, startValue, changeInValue, totalIterations){
return changeInValue * (1 - Math.cos(currentIteration / totalIterations * (Math.PI / 2))) + startValue;
},
easeOutSine:function(currentIteration, startValue, changeInValue, totalIterations){
return changeInValue * Math.sin(currentIteration / totalIterations * (Math.PI / 2)) + startValue;
},
easeInOutSine:function(currentIteration, startValue, changeInValue, totalIterations){
return changeInValue / 2 * (1 - Math.cos(Math.PI * currentIteration / totalIterations)) + startValue;
},
easeInExpo:function(currentIteration, startValue, changeInValue, totalIterations){
return changeInValue * Math.pow(2, 10 * (currentIteration / totalIterations - 1)) + startValue;
},
easeOutExpo:function(currentIteration, startValue, changeInValue, totalIterations){
return changeInValue * (-Math.pow(2, -10 * currentIteration / totalIterations) + 1) + startValue;
},
easeInOutExpo:function(currentIteration, startValue, changeInValue, totalIterations){
if((currentIteration /=totalIterations / 2) < 1){
return changeInValue / 2 * Math.pow(2, 10 * (currentIteration - 1)) + startValue;
}
return changeInValue / 2 * (-Math.pow(2, -10 * --currentIteration) + 2) + startValue;
},
easeInCirc:function(currentIteration, startValue, changeInValue, totalIterations){
return changeInValue * (1 - Math.sqrt(1 - (currentIteration /=totalIterations) * currentIteration)) + startValue;
},
easeOutCirc:function(currentIteration, startValue, changeInValue, totalIterations){
return changeInValue * Math.sqrt(1 - (currentIteration=currentIteration / totalIterations - 1) * currentIteration) + startValue;
},
easeInOutCirc:function(currentIteration, startValue, changeInValue, totalIterations){
if((currentIteration /=totalIterations / 2) < 1){
return changeInValue / 2 * (1 - Math.sqrt(1 - currentIteration * currentIteration)) + startValue;
}
return changeInValue / 2 * (Math.sqrt(1 - (currentIteration -=2) * currentIteration) + 1) + startValue;
}};})(jQuery);
(function($){
'use strict';
MK.component.SocialShare=function(el){
var networks={
twitter:'http://twitter.com/intent/tweet?text={title} {url}',
pinterest:'http://pinterest.com/pin/create/button/?url={url}&media={image}&description={title}',
facebook:'https://www.facebook.com/sharer/sharer.php?u={url}',
googleplus:'https://plus.google.com/share?url={url}',
linkedin:'http://www.linkedin.com/shareArticle?mini=true&url={url}&title={title}&summary={desc}',
digg:'http://digg.com/submit?url={url}&title={title}',
reddit:'http://reddit.com/submit?url={url}&title={title}',
};
this.networks=networks;
this.el=el;
};
MK.component.SocialShare.prototype={
init:function(){
this.cacheElements();
this.bindEvents();
},
cacheElements:function(){
this.$this=$(this.el);
},
bindEvents:function(){
var thisObject=this;
var tempClass="";
$.each(this.networks, function(key, value){
thisObject.$tempClass=$('.' + key + '-share');
thisObject.$tempClass.click(thisObject.openSharingDialog.bind(self, this, key));
});
},
openSharingDialog:function(url, site, args){
var urlWrapper=url;
var rx=new RegExp('\{[a-z]*\}','g'), res;
var match=rx.exec(url);
while (match!=null){
var pureAttr=match[0].replace("{", "").replace("}" , "");
var attValue=$(args.currentTarget).attr('data-' + pureAttr);
if(attValue===undefined||attValue===null){
attValue="";
}
attValue=attValue.replace('#', '%23');
urlWrapper=urlWrapper.replace(match, attValue);
match=rx.exec(url);
}
window.open(urlWrapper, site + "Window", "height=320,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0");
},
};
var $body=$('body');
if(!$body.length) return;
$body.each(function(){
var socialShare=new MK.component.SocialShare(this);
socialShare.init();
});
})(jQuery);
(function($){
'use strict';
MK.component.Sortable=function(el){
this.el=el;
};
MK.component.Sortable.prototype={
init: function init(){
this.cacheElements();
this.bindEvents();
},
cacheElements: function cacheElements(){
this.unique=Date.now();
this.$filter=$(this.el);
this.config=this.$filter.data('sortable-config');
this.ajaxLoader=new MK.utils.ajaxLoader(this.config.container);
this.ajaxLoader.init();
this.$container=$(this.config.container);
this.$navItems=this.$filter.find('a');
this.$filterItems=this.$container.find(this.config.item);
},
bindEvents: function bindEvents(){
this.$navItems.on('click', this.handleClick.bind(this));
MK.utils.eventManager.subscribe('ajaxLoaded', this.onLoad.bind(this));
},
handleClick: function handleClick(e){
e.preventDefault();
var $item=$(e.currentTarget);
var term=$item.data('filter');
this.$navItems.removeClass('current');
$item.addClass('current');
if(this.config.mode==='ajax') this.inDB(term, $item);
else this.inPage(term);
},
inDB: function inDB(term, $item){
MK.ui.loader.remove(this.$filter);
MK.ui.loader.add($item);
if(this.$container.siblings('.mk-ajax-loaded-posts').length){
this.$container.siblings('.mk-ajax-loaded-posts').attr('data-loop-loaded-posts', '');
}
this.ajaxLoader.setData({
paged: 1,
term: term
});
this.ajaxLoader.load(this.unique);
},
inPage: function inPage(term){
var $filterItems=this.$container.find(this.config.item);
$filterItems.removeClass('is-hidden');
var className=term.replace(/, /g, ", .");
if(term!=='*') $filterItems.not('.' + className).addClass('is-hidden');
MK.utils.eventManager.publish('staticFilter');
},
onLoad: function onLoad(e, response){
if(this.config.mode==='static'){
this.$navItems.removeClass('current').first().addClass('current');
}
if(typeof response!=='undefined'&&response.id===this.config.container){
MK.ui.loader.remove(this.$filter);
if(response.unique===this.unique){
this.$container.html(response.content);
this.ajaxLoader.setData({paged: 1});
}}
}};})(jQuery);
(function($){
'use strict';
MK.component.Tabs=function(el){
var defaults={
activeClass:'is-active'
};
this.config=defaults;
this.el=el;
};
MK.component.Tabs.prototype={
init:function(){
this.cacheElements();
this.bindEvents();
},
cacheElements:function(){
this.$this=$(this.el);
this.$tabs=this.$this.find('.mk-tabs-tab');
this.$panes=this.$this.find('.mk-tabs-pane');
this.currentId=0;
},
bindEvents:function(){
var self=this;
this.$tabs.on('click', this.switchPane.bind(this));
},
switchPane:function(evt){
evt.preventDefault();
var clickedId=$(evt.currentTarget).index();
this.hide(this.currentId);
this.show(clickedId);
this.currentId=clickedId;
MK.utils.eventManager.publish('item-expanded');
},
show:function(id){
this.$tabs.eq(id).addClass(this.config.activeClass);
this.$panes.eq(id).addClass(this.config.activeClass);
},
hide:function(id){
this.$tabs.eq(id).removeClass(this.config.activeClass);
this.$panes.eq(id).removeClass(this.config.activeClass);
}};})(jQuery);
function mk_tabs(){
}
function mk_tabs_responsive(){
}
(function($){
'use strict';
$(document).on('click', function(e){
$('.mk-toggle-trigger').removeClass('mk-toggle-active');
});
function toggle(e){
e.preventDefault();
e.stopPropagation();
var $this=$(e.currentTarget);
if(!$this.hasClass('mk-toggle-active')){
$('.mk-box-to-trigger').fadeOut(200);
$this.parent().find('.mk-box-to-trigger').fadeIn(250);
$('.mk-toggle-trigger').removeClass('mk-toggle-active');
$this.addClass('mk-toggle-active');
}else{
$('.mk-box-to-trigger').fadeOut(200);
$this.removeClass('mk-toggle-active');
}}
function assignToggle(){
setTimeout(function(){
$('.mk-toggle-trigger').off('click', toggle);
$('.mk-toggle-trigger').on('click', toggle);
}, 100);
}
assignToggle();
MK.utils.eventManager.subscribe('ajaxLoaded', assignToggle);
MK.utils.eventManager.subscribe('ajax-preview', assignToggle);
$(window).on('vc_reload', function(){
assignToggle();
MK.utils.eventManager.subscribe('ajaxLoaded', assignToggle);
MK.utils.eventManager.subscribe('ajax-preview', assignToggle);
});
}(jQuery));
(function($){
'use strict';
var $iframes=$('iframe');
$iframes.each(function(){
var $iframe=$(this);
var parent=$iframe.parent().get(0);
var tagName=parent.tagName;
if(tagName==='P') $iframe.wrap('
');
});
}(jQuery));
function product_loop_add_cart(){
var $body=$('body');
$body.on('click', '.add_to_cart_button', function(){
var icon=' ';
var $holder=$(this).parents('.product:eq(0)');
var $i=$holder.find('.product-loading-icon');
$holder.addClass('adding-to-cart').removeClass('added-to-cart');
$i.html(icon);
});
$body.bind('added_to_cart', function(){
var icon=' ';
var $holder=$('.adding-to-cart');
var $i=$holder.find('.product-loading-icon');
$holder.removeClass('adding-to-cart').addClass('added-to-cart');
$i.html(icon);
});
}
(function($){
'use strict';
if(MK.utils.isMobile()){
$('.mk-animate-element').removeClass('mk-animate-element');
return;
}
var init=function init(){
var $rootLevelEls=$('.js-master-row, .widget');
$rootLevelEls.each(spyViewport);
$rootLevelEls.each(function rootLevelEl(){
var $animateEl=$(this).find('.mk-animate-element');
$animateEl.each(spyViewport);
var browserName=MK.utils.browser.name;
if(browserName==='Firefox'){
var $rightToLeft=$(this).find('.right-to-left');
if($rightToLeft.length > 0){
$('#theme-page').css('overflow-x', 'hidden');
}}
});
};
var spyViewport=function spyViewport(i){
var self=this;
MK.utils.scrollSpy(this, {
position:'bottom',
threshold:200,
after:function(){
animate.call(self, i);
}});
};
var animate=function animate(i){
var $this=$(this);
setTimeout(function(){
$this.addClass('mk-in-viewport');
}, 100 * i);
};
$(window).on('load vc_reload', init);
}(jQuery));
(function($){
'use strict';
$(window).on('load', function(){
MK.core.initAll(document);
MK.utils.scrollToURLHash();
setTimeout(function(){
MK.ui.preloader.hide();
$('.mk-preloader').hide();
$('body').removeClass('loading');
}, 150);
});
$(window).on('vc_reload', function(){
setTimeout(function(){
MK.core.initAll(document);
}, 100);
});
$(document).on('click', '.js-smooth-scroll, .js-main-nav a', smoothScrollToAnchor);
$('.side_dashboard_menu a').on('click', smoothScrollToAnchor);
function smoothScrollToAnchor(evt){
var anchor=MK.utils.detectAnchor(this);
var $this=$(evt.currentTarget);
var loc=window.location;
var currentPage=loc.origin + loc.pathname;
var href=$this.attr('href');
var linkSplit=(href) ? href.split('#'):'';
var hrefPage=linkSplit[0] ? linkSplit[0]:'';
var hrefHash=linkSplit[1] ? linkSplit[1]:'';
if(anchor.length){
if(hrefPage===currentPage||hrefPage==='') evt.preventDefault();
MK.utils.scrollToAnchor(anchor);
}else if($this.attr('href')==='#'){
evt.preventDefault();
}}
}(jQuery));})(jQuery);
(function($){
'use strict';
$('.js-header-shortcode').each(function(){
var $this=$(this),
$parent_page_section=$this.parents('.mk-page-section'),
$parent_row=$this.parents('.js-master-row'),
$is_inside=$parent_page_section.attr('id');
if($is_inside){
$this.detach().appendTo($parent_page_section);
}
$parent_page_section.css({
'overflow': 'visible'
});
$parent_row.css({
'overflow': 'visible'
});
$this.parent().css('z-index', 99999);
});
})(jQuery);
(function($){
'use strict';
var AjaxModal=function AjaxModal(el){
this.el=el;
var $this=$(el);
var action=$this.data('action');
var id=$this.data('id');
this.load(action, id);
};
AjaxModal.prototype={
init: function init(html){
var self=this;
$('body').append(html);
this.cacheElements();
this.bindEvents();
this.$modal.addClass('is-active');
MK.core.initAll(self.$modal.get(0));
$('.variations_form').each(function(){
$(this).wc_variation_form().find('.variations select:eq(0)').change();
});
MK.utils.scroll.disable();
MK.ui.loader.remove();
MK.utils.eventManager.publish('quickViewOpen');
},
cacheElements: function cacheElement(){
this.$modal=$('.mk-modal');
this.$slider=this.$modal.find('.mk-slider-holder');
this.$container=this.$modal.find('.mk-modal-container');
this.$closeBtn=this.$modal.find('.js-modal-close');
},
bindEvents: function bindEvents(){
this.$container.on('click', function(e){
e.stopPropagation();
});
this.$closeBtn.on('click', this.handleClose.bind(this));
this.$modal.on('click', this.handleClose.bind(this));
},
handleClose: function handleClose(e){
e.preventDefault();
MK.utils.scroll.enable();
this.close();
},
close: function close(){
this.$modal.remove();
},
load: function load(action, id){
$.ajax({
url: MK.core.path.ajaxUrl,
data: {
action: action,
id: id
},
success: this.init.bind(this),
error: this.error.bind(this)
});
},
error: function error(response){
console.log(response);
}};
var createModal=function createModal(e){
e.preventDefault();
var el=e.currentTarget;
MK.ui.loader.add($(el).parents('.product-loop-thumb'));
new AjaxModal(el);
};
$(document).on('click', '.js-ajax-modal', createModal);
$(window).on('vc_reload', function(){
$('.mk-product-loop').each(function(){
var id=$(this).attr('id');
var el='#' + id + ' > .products.js-el';
$(el).data('init-Grid', true);
var component=new MK.component[ 'Grid' ](el);
component.init();
});
});
})(jQuery);
(function($){
var windowSel=$(window);
var bodySel=$('body');
var fixedSel=$('.mkhb-fixed');
var stickySel=$('.mkhb-sticky');
var normalRespNav=$('.mkhb-navigation-resp__normal');
var stickyRespNav=$('.mkhb-navigation-resp__sticky');
var windowHeight=windowSel.height();
var adminBarHeight=0;
function mkhbGetOffset(offset, device){
var deviceEl=$('.mkhb-' + device);
var $deviceHeight=deviceEl.height();
var $offset=0;
if(typeof offset==='string'&&offset!=='header'){
$offset=Math.round(( parseInt(offset) / 100) * windowHeight);
}else if(typeof offset==='number'){
$offset=parseInt(offset);
}
if(0==$offset||isNaN($offset)){
$offset=$deviceHeight;
if(deviceEl.hasClass('mkhb-overlap')){
$offset=deviceEl.children('.mkhb-device-container').height();
}}
if($deviceHeight > $offset){
$offset=$deviceHeight;
}
return $offset;
}
function mkhbUpdateTop(){
adminBarHeight=$('#wpadminbar').height();
adminBarHeight=(adminBarHeight==null) ? 0:adminBarHeight;
}
function mkhbSetFixedHeight(selector){
selector.each(function(e){
var thisSel=$(this);
if(! thisSel.hasClass('mkhb-overlap')){
var childHeight=thisSel.children('.mkhb-device-container').height();
thisSel.height(childHeight);
}});
}
function mkhbSlideDown(current, offset, device, curHeight){
var onScroll=function onScroll(){
var addOffset=mkhbAddRespNormal(offset, device);
if(windowSel.scrollTop() > addOffset){
current.css({ 'top': adminBarHeight });
current.addClass('mkhb-sticky--active');
}else{
current.css({ 'top': -curHeight });
current.removeClass('mkhb-sticky--active');
mkhbHideRespBurger();
}};
onScroll();
windowSel.on('scroll', onScroll);
}
function mkhbLazy(current, offset, device, curHeight){
var lastScrollPos=0;
var onScroll=function onScroll(){
var addOffset=mkhbAddRespNormal(offset, device);
var scrollPos=windowSel.scrollTop();
if(scrollPos > addOffset&&scrollPos < lastScrollPos){
current.css({ 'top': adminBarHeight });
current.addClass('mkhb-sticky--active');
}else{
current.css({ 'top': -curHeight });
current.removeClass('mkhb-sticky--active');
mkhbHideRespBurger();
}
lastScrollPos=scrollPos;
};
onScroll();
windowSel.on('scroll', onScroll);
}
function mkhbHideRespBurger(){
if(stickyRespNav.length <=0){
return;
}
if($('body[class*="mkhb-navigation-resp--opened"]') <=0){
return;
}
stickyRespNav.each(function(){
var wrap=$(this);
var id=wrap.attr('id').replace('-wrap', '');
var current=$('#' + id).find('.mkhb-navigation-resp');
if(bodySel.hasClass('mkhb-navigation-resp--opened-' + id)){
current.removeClass('is-active').find('.mkhb-navigation-resp__container').removeClass('fullscreen-active');
bodySel.removeClass('mkhb-navigation-resp--opened-' + id).addClass('mkhb-navigation-resp--closed-' + id).trigger('mkhb-navigation-resp--closed-' + id);
wrap.hide();
}});
}
function mkhbAddRespNormal(offset, device){
if(normalRespNav.length <=0){
return offset;
}
if($('body[class*="mkhb-navigation-resp--opened"]') <=0){
return offset;
}
var deviceEl=$('.mkhb-' + device);
var deviceHeight=deviceEl.height();
normalRespNav.each(function(){
var current=$(this);
var height=current.height();
var id=current.attr('id').replace('-wrap', '');
if(bodySel.hasClass('mkhb-navigation-resp--opened-' + id)){
var newOffset=deviceHeight + parseInt(height);
if(newOffset > offset){
offset=newOffset;
}
return offset;
}});
return offset;
}
var resizeHeader=function resizeHeader(){
var fixedRsz=$('.mkhb-fixed');
if(fixedRsz.length > 0){
mkhbSetFixedHeight(fixedRsz);
}}
if(fixedSel.length > 0){
mkhbSetFixedHeight(fixedSel);
windowSel.on('resize', resizeHeader);
}
var initialAction=function initialAction(){
if(stickySel.length > 0){
stickySel.each(function(e){
var current=$(this);
var offset=current.data('offset');
var device=current.data('device');
offset=mkhbGetOffset(offset, device);
mkhbUpdateTop();
var curHeight=current.height();
current.css({ 'top': -curHeight });
var effect=current.data('effect');
if(effect=='slide-down'){
mkhbSlideDown(current, offset, device, curHeight);
}else if(effect=='lazy'){
mkhbLazy(current, offset, device, curHeight);
}});
}}
windowSel.on('load', initialAction);
windowSel.on('resize', mkhbUpdateTop);
})(jQuery);
(function($){
var inlineContainer=$('.mkhb-col__container-inline');
if(inlineContainer.length > 0){
inlineContainer.css('opacity', '0');
$.each(inlineContainer, function(key, value){
var thisContainer=$(this);
var thisChildren=thisContainer.children();
if(thisChildren.length < 1){
return;
}
var inlineStatus=false;
var inlineContent='';
var inlineTypes=[];
inlineTypes['left']='';
inlineTypes['center']='';
inlineTypes['right']='';
var countEls=thisChildren.length;
$.each(thisChildren, function(key, value){
elSel=$(this);
--countEls;
var elMarkup=elSel[0].outerHTML;
var elDisplay='inline';
var elAlign='left';
if(elMarkup){
elDisplay=elSel.data('display')||'block';
}
if('inline'==elDisplay){
elAlign=elSel.data('align')||'left';
inlineTypes[ elAlign ] +=elMarkup;
elMarkup='';
inlineStatus=true;
}
if(inlineStatus&&('block'==elDisplay||countEls <=0)){
inlineContent +=setInlineContainer(inlineTypes);
inlineStatus=false;
inlineTypes['left']='';
inlineTypes['center']='';
inlineTypes['right']='';
}
inlineContent +=elMarkup;
});
thisContainer.html(inlineContent);
});
inlineContainer.css('opacity', '1');
}
function setInlineContainer(inlineElements){
leftContainer='' + inlineElements['left'] + '
';
rightContainer='' + inlineElements['right'] + '
';
centerContainer='' + inlineElements['center'] + '
';
if(''==inlineElements['center']){
centerContainer='';
if(''==inlineElements['left']){
leftContainer='';
}
if(''==inlineElements['right']){
rightContainer='';
}}
if(''==inlineElements['left']&&''==inlineElements['right']){
leftContainer='';
rightContainer='';
}
columnContent='' + leftContainer + centerContainer + rightContainer + '
';
return columnContent;
}})(jQuery);
(function($){
var burger_menu_container=$('.mkhb-navigation-resp__container--burger-desktop');
burger_menu_container.on('click', function(e){
var $this=$(this),
$body=$('body'),
$fullscreen_box=$this.parent().find('.mkhb-navigation-resp__nav');
if(e.stopPropagation){
e.stopPropagation();
}else if(window.event){
window.event.cancelBubble=true;
}
if($this.hasClass('dashboard-style')){
if(! $this.hasClass('dashboard-active')){
$this.addClass('dashboard-active');
$body.addClass('dashboard-opened');
}else{
$this.removeClass('dashboard-active');
$body.removeClass('dashboard-opened');
}}else if($this.hasClass('fullscreen-style')){
if(! $this.hasClass('fullscreen-active')){
$this.addClass('fullscreen-active');
$body.addClass('fullscreen-nav-opened');
$fullscreen_box.addClass('opened');
}else{
$this.removeClass('fullscreen-active');
$body.removeClass('fullscreen-nav-opened');
$fullscreen_box.removeClass('opened');
}}
e.preventDefault();
});
$('.mk-fullscreen-nav-close, .mk-fullscreen-nav-wrapper, #fullscreen-navigation a').on('click', function(e){
burger_menu_container.removeClass('fullscreen-active');
});
})(jQuery);
(function($){
'use strict';
window.MK=window.MK||{};
MK.HB=MK.HB||{};
$('.mkhb-navigation-resp__arrow').stop(true).on('click', function(e){
e.preventDefault();
var $this=$(this);
if($this.hasClass('mkhb-navigation-resp__sub-closed')){
$this.siblings('ul').slideDown(450).end().removeClass('mkhb-navigation-resp__sub-closed').addClass('mkhb-navigation-resp__sub-opened');
}else{
$this.siblings('ul').slideUp(450).end().removeClass('mkhb-navigation-resp__sub-opened').addClass('mkhb-navigation-resp__sub-closed');
}});
var $window=$(window);
var $body=$('body');
var $resMenuWrap=$('.mkhb-navigation-resp__wrap');
var $resMenuLink=$('.mkhb-navigation-resp__container');
var $resSubMenuLink=$('.mkhb-navigation-resp__arrow');
var $bottomCorner=$('.bottom-corner-btns.js-bottom-corner-btns');
var hasResMenu=($resMenuWrap.length > 0);
var windowHeight=$window.height();
var screenHeight=screen.height;
if(!hasResMenu) return;
function toggleResMenu(e){
e.preventDefault();
var container=$(this);
var $this=container.parent();
var device=$this.data('device');
if(device==='desktop'){
return;
}
var $parentID=$this.parent().attr('id');
var $headerInner=$this.parents('header');
var $resMenu=$headerInner.find('#' + $parentID + '-wrap.mkhb-navigation-resp__wrap');
var searchBox=$('.mkhb-navigation-resp__searchform .text-input');
var adminBarHeight=$('#wpadminbar').height();
var fixedStickyActive=false;
var $stickyHeader=$this.parents('.mkhb-sticky');
var currentScroll=0;
if($stickyHeader.length > 0){
var currentScroll=$window.scrollTop();
fixedStickyActive=true;
}
var $fixedHeader=$this.parents('.mkhb-fixed');
if($fixedHeader.length > 0){
fixedStickyActive=true;
}
var checkContainer=$('.mkhb-' + device);
var checkRespMenu=checkContainer.find('.mkhb-navigation-resp');
if(checkRespMenu.length > 0){
checkRespMenu.each(function(){
var $menu=$(this);
var $parentMenu=$menu.parent().attr('id');
if($parentID==$parentMenu){
return;
}
var $menuWrap=$headerInner.find('#' + $parentMenu + '-wrap.mkhb-navigation-resp__wrap');
if($body.hasClass('mkhb-navigation-resp--opened-' + $parentMenu)){
$menu.removeClass('is-active').find('.mkhb-navigation-resp__container').removeClass('fullscreen-active');
$body.removeClass('mkhb-navigation-resp--opened-' + $parentMenu).addClass('mkhb-navigation-resp--closed-' + $parentMenu).trigger('mkhb-navigation-resp--closed-' + $parentMenu);
$menuWrap.hide();
}});
if(currentScroll > 0){
window.scrollTo(0, currentScroll);
}}
if($body.hasClass('mkhb-navigation-resp--opened-' + $parentID)){
$this.removeClass('is-active').find('.mkhb-navigation-resp__container').removeClass('fullscreen-active');
$body.removeClass('mkhb-navigation-resp--opened-' + $parentID).addClass('mkhb-navigation-resp--closed-' + $parentID).trigger('mkhb-navigation-resp--closed-' + $parentID);
$resMenu.hide();
if(fixedStickyActive){
$bottomCorner.show();
}}else{
$this.addClass('is-active').find('.mkhb-navigation-resp__container').addClass('fullscreen-active');
$body.removeClass('mkhb-navigation-resp--closed-' + $parentID).addClass('mkhb-navigation-resp--opened-' + $parentID).trigger('mkhb-navigation-resp--opened-' + $parentID);
$resMenu.show();
if(fixedStickyActive){
$bottomCorner.hide();
}}
stickyFixedScrollable($this, $resMenu);
if(searchBox.hasClass('input-focused')){
searchBox.removeClass('input-focused');
}}
$resMenuLink.each(function(){
$(this).on('click', toggleResMenu);
});
function toggleResSubMenu(e){
var $this=$(this);
var respMenu=$this.parents('.mkhb-navigation-resp__wrap');
var respIDRaw=respMenu.attr('id');
var respID=respIDRaw.replace('-wrap', '');
var respButton=$('#' + respID);
setTimeout(function(){
stickyFixedScrollable(respButton, respMenu);
}, 300);
}
$resSubMenuLink.each(function(){
$(this).on('click', toggleResSubMenu);
});
function stickyFixedScrollable(respButton, respMenu){
var stickyHeader=respButton.parents('.mkhb-sticky');
var fixedHeader=respButton.parents('.mkhb-fixed');
var headerContHeight=0;
if(stickyHeader.length > 0){
headerContHeight=stickyHeader.height();
}else if(fixedHeader.length > 0){
headerContHeight=fixedHeader.height();
}
if(headerContHeight < 1){
return;
}
respMenu.css({ 'height': 'auto' });
var adminBarHeight=$('#wpadminbar').height();
var respMenuHeight=respMenu.height();
var headerHeight=adminBarHeight + headerContHeight + respMenuHeight;
var winHeight=window.innerHeight ? window.innerHeight:windowHeight;
if(headerHeight > winHeight){
var newRespHeight=winHeight - adminBarHeight - headerContHeight;
respMenu.css({
'height': newRespHeight + 'px',
}).children().css({
'height': '100%',
'overflow': 'scroll',
});
}else{
respMenu.css({
'height': 'auto',
}).children().removeAttr('style');
}}
var setResMenuHeight=function(){
var height=$window.height() - MK.HB.val.offsetHeaderHeight(0);
$resMenuWrap.css('max-height', height);
};
var isVirtualKeyboard=function(){
var currentWindowHeight=$window.height();
var currentScreenHeight=screen.height;
var searchBox=$('.mkhb-navigation-resp__searchform .text-input');
var searchBoxIsFocused=false;
searchBox.on('touchstart touchend', function(e){
searchBox.addClass('input-focused');
});
searchBoxIsFocused=(searchBox.is(':focus')||searchBox.hasClass("input-focused"));
if($body.hasClass('[class^="mkhb-navigation-resp--opened"]')&&searchBoxIsFocused&¤tScreenHeight==screenHeight&¤tWindowHeight!=windowHeight){
return true;
}else{
return false;
}};
var hideResMenu=function hideResMenu(){
if(MK.HB.utils.isResponsiveMenuState()){
if(!isVirtualKeyboard()){
if($body.hasClass('[class^="mkhb-navigation-resp--opened"]')){
$resMenuLink.filter('.is-active').trigger('click');
}
$resMenuWrap.hide();
}}
};
$resMenuWrap.on('click', 'a', hideResMenu);
var headerOverlap=$('.mkhb-overlap');
var headerFixed=$('.mkhb-fixed');
var headerSticky=$('.mkhb-sticky');
var hasOverlap=(headerOverlap.length > 0);
var hasFixed=(headerFixed.length > 0);
var hasSticky=(headerSticky.length > 0);
var renderedStyle=[];
if(! hasOverlap&&! hasSticky&&! hasFixed){
return;
}
var repositionRespNav=function repositionRespNav(){
var parent=$('.hb-devices');
var container=$(this);
var device=container.data('device');
var workspace=container.data('workspace');
var fixed=container.hasClass('mkhb-fixed--filled');
var combine=workspace + '-' + device;
var top=$('#wpadminbar').height();
top=(top==null) ? 0:top;
if(device==='desktop'||renderedStyle.indexOf(combine) > -1){
return;
}
var height=container.find('.mkhb-device-container').height();
if(height <=0){
return;
}
var style={};
var target='';
if(workspace==='normal'&&! fixed){
style['position']='absolute';
style['height']='auto';
style['top']=height + 'px';
target='.mkhb-navigation-resp__' + workspace + '.mkhb-navigation-resp__' + device;
}else{
style['position']='fixed';
style['height']='auto';
style['top']=(top + height) + 'px';
target='.mkhb-navigation-resp__' + workspace + '.mkhb-navigation-resp__' + device;
}
if(! style||! target){
return;
}
parent.find(target).css(style);
renderedStyle.push(combine);
}
var setPositionRespNav=function setPositionRespNav(){
if(renderedStyle.length < 4){
var headerContainer='';
if(hasOverlap){
$('.mkhb-overlap').each(repositionRespNav);
}
if(hasFixed){
$('.mkhb-fixed').each(repositionRespNav);
}
if(hasSticky){
$('.mkhb-sticky').each(repositionRespNav);
}}
}
$window.on('load', setPositionRespNav);
$window.on('resize', setPositionRespNav);
if(hasSticky){
$window.on('scroll', setPositionRespNav);
}}(jQuery));
window.MK=window.MK||{};
MK.HB=MK.HB||{};
(function ($, window, document, undefined){
var pluginName="HbMegaMenu",
defaults={
propertyName: "value"
};
var delayOut=400;
var menus=[];
function HbCustomMenu(element, options){
this.element=element;
this.options=$.extend({}, defaults, options);
this._defaults=defaults;
this._name=pluginName;
this.init();
}
HbCustomMenu.prototype={
isOpen: false,
timeout: null,
init: function (){
var that=this;
$(this).each(function(index, menu){
that.node=menu.element;
that.addListeners(menu.element);
var $menu=$(menu.element);
$menu.addClass("dropdownJavascript");
menus.push(menu.element);
$menu.find('ul > li').each(function(index, submenu){
if($(submenu).find('ul').length > 0){
$(submenu).addClass('with-menu');
}});
});
},
addListeners: function(menu){
var that=this;
$(menu).mouseover(function(e){
that.handleMouseOver.call(that, e);
}).mouseout(function(e){
that.handleMouseOut.call(that, e);
});
},
handleMouseOver: function (e){
var that=this;
this.clearTimeout();
var item=e.target||e.srcElement;
while (item.nodeName!='LI'&&item!=this.node){
item=item.parentNode;
}
if(item.nodeName=='LI'){
this.toOpen=item;
this.timeout=setTimeout(function(){
that.open.call(that);
}, this.options.delay);
}},
handleMouseOut: function (){
var that=this;
this.clearTimeout();
var _delayOut=this.options.delay;
if(delayOut){
_delayOut=delayOut;
}
this.timeout=setTimeout(function(){
that.close.call(that);
}, _delayOut);
},
clearTimeout: function (){
if(this.timeout){
clearTimeout(this.timeout);
this.timeout=null;
}},
open: function (){
var that=this;
this.isOpen=true;
var items=$(this.toOpen).parent().children('li');
$(items).each(function(index, item){
$(item).find("ul").each(function(index, submenu){
if(item!=that.toOpen){
$(item).removeClass("dropdownOpen");
that.close(item);
}else if(!$(item).hasClass('dropdownOpen')){
$(item).addClass("dropdownOpen");
var left=0;
var node=submenu;
while (node){
left +=Math.abs(node.offsetLeft);
node=node.offsetParent;
}
var right=left + submenu.offsetWidth;
var menuHeight=$(submenu).outerHeight();
var parentTop=$(submenu).offset().top - $(window).scrollTop();
$(item).removeClass('dropdownRightToLeft');
if(left < 0) $(item).addClass('dropdownLeftToRight');
if(right > document.body.clientWidth){
$(item).addClass('dropdownRightToLeft');
}}
});
});
},
close: function (node){
if(!node){
this.isOpen=false;
node=this.node;
}
$(node).find('li').each(function(index, item){
$(item).removeClass('dropdownOpen');
});
}};
$.fn[pluginName]=function (options){
return this.each(function (){
if(!$.data(this, "plugin_" + pluginName)){
$.data(this, "plugin_" + pluginName,
new HbCustomMenu(this, options));
}});
};})(jQuery, window, document);
(function($){
'use strict';
var onePageNavItem=function onePageNavItem(){
var $this=$(this),
link=$this.find('a'),
anchor=MK.HB.utils.detectAnchor(link);
if(!anchor.length) return;
$this.removeClass('current-menu-item current-menu-ancestor current-menu-parent');
var activeNav=function(state){
return function(){
$this[ state ? 'addClass':'removeClass' ]('current-menu-item');
window.history.replaceState(undefined, undefined, [ state ? anchor:' ' ]);
};};
MK.HB.utils.scrollSpy($(anchor)[0], {
before:activeNav(false),
active:activeNav(true),
after:activeNav(false),
});
};
var $navItems=$('.mkhb-js-nav').find('li');
$(window).on('load', function(){
setTimeout(function(){
$navItems.each(onePageNavItem);
}, 1000);
});
}(jQuery));
(function($){
'use strict';
var MK=window.MK||{};
MK.HB=window.MK.HB||{};
MK.HB.utils=window.MK.HB.utils||{};
MK.HB.val=window.MK.HB.val||window.MK.val||{};
MK.HB.utils.scrollTo=function(offset){
$('html, body').stop().animate({
scrollTop: offset
}, {
duration: 1200,
easing: "easeInOutExpo"
});
};
MK.HB.utils.scrollToAnchor=function(hash){
var $target=$(hash);
if(! $target.length) return;
var offset=$target.offset().top;
offset=offset - MK.HB.val.offsetHeaderHeight(offset);
if(hash==='#top-of-page') window.history.replaceState(undefined, undefined, ' ');
else window.history.replaceState(undefined, undefined, hash);
MK.HB.utils.scrollTo(offset);
};
MK.HB.utils.scroll=(function(){
var keys=[38, 40];
function preventDefault(e){
e=e||window.event;
e.preventDefault();
e.returnValue=false;
}
function wheel(e){
preventDefault(e);
}
function keydown(e){
for (var i=keys.length; i--;){
if(e.keyCode===keys[i]){
preventDefault(e);
return;
}}
}
function disableScroll(){
if(window.addEventListener){
window.addEventListener('DOMMouseScroll', wheel, false);
}
window.onmousewheel=document.onmousewheel=wheel;
document.onkeydown=keydown;
}
function enableScroll(){
if(window.removeEventListener){
window.removeEventListener('DOMMouseScroll', wheel, false);
}
window.onmousewheel=document.onmousewheel=document.onkeydown=null;
}
return {
disable:disableScroll,
enable:enableScroll
};})();
MK.HB.utils.detectAnchor=function(el){
var $this=$(el),
href=$this.attr('href'),
linkSplit=(href) ? href.split('#'):'',
hrefHash=linkSplit[1] ? linkSplit[1]:'';
if(typeof hrefHash!=='undefined'&&hrefHash!==''){
return '#' + hrefHash;
}else{
return false;
}};
MK.HB.utils.scrollToURLHash=function(){
var loc=window.location,
hash=loc.hash;
if(hash.length&&hash.substring(1).length){
hash=hash.replace('!loading', '');
setTimeout(function(){
MK.HB.utils.scrollToAnchor(hash);
}, 1000);
setTimeout(function(){
window.history.replaceState(undefined, undefined, hash);
}, 1001);
}};
MK.HB.utils.scrollSpy=function(toSpy, config){
var $window=$(window),
container=document.getElementById('mk-theme-container'),
isObj=(typeof toSpy==='object'),
offset=(isObj) ? MK.HB.val.dynamicOffset(toSpy, config.position, config.threshold):function(){ return toSpy; },
height=(isObj) ? MK.HB.val.dynamicHeight(toSpy):function(){ return 0; },
cacheVals={},
_p='before';
var checkPosition=function(){
var s=MK.HB.val.scroll(),
o=offset(),
h=height();
if(s < o&&_p!=='before'){
if(config.before) config.before();
_p='before';
}
else if(s >=o&&s <=o + h&&_p!=='active'){
if(config.active) config.active(o);
_p='active';
}
else if(s > o + h&&_p!=='after'){
if(config.after) config.after(o + h);
_p='after';
}};
var rAF=function(){
window.requestAnimationFrame(checkPosition);
};
var exportVals=function(){
return cacheVals;
};
var updateCache=function(){
var o=offset(),
h=height();
cacheVals={
before:o - $window.height(),
active:o,
after:o + h
};};
if(config.cache){
config.cache(exportVals);
}
checkPosition();
$window.on('load', checkPosition);
$window.on('resize', checkPosition);
$window.on('mouseup', checkPosition);
window.addResizeListener(container, checkPosition);
$window.on('scroll', rAF);
updateCache();
$window.on('load', updateCache);
$window.on('resize', updateCache);
window.addResizeListener(container, updateCache);
};}(jQuery));
(function($){
'use strict';
var hasTouchscreen=('ontouchstart' in document.documentElement);
if(!hasTouchscreen) return;
$('.mkhb-navigation .menu-item-has-children').each(normalizeClick);
function normalizeClick(){
$(this).on('click', handleClick);
}
function handleClick(e){
var $this=$(e.currentTarget);
var $child=$this.find('> ul');
var isVisible=$child.css('display')!=='none';
if(!isVisible){
e.preventDefault();
e.stopPropagation();
}}
}(jQuery));
(function($){
'use strict';
var $navList=$('.mkhb-navigation-ul');
var hbMegaMenu=function hbMegaMenu(){
$navList.HbMegaMenu({
type: "vertical",
delay: 200
});
};
$(window).on('load', hbMegaMenu);
var $hb_lang_item=$('.mkhb-navigation > .mkhb-navigation-ul > .menu-item-language');
$hb_lang_item.addClass('mkhb-no-mega-menu').css('visibility', 'visible');
$('.mkhb-navigation .menu-item-language > a').addClass('menu-item-link');
$(document).on('click', '.mkhb-js-smooth-scroll, .mkhb-js-nav a', smoothScrollToAnchor);
function smoothScrollToAnchor(evt){
var anchor=MK.HB.utils.detectAnchor(this);
var $this=$(evt.currentTarget);
var loc=window.location;
var currentPage=loc.origin + loc.pathname;
var href=$this.attr('href');
var linkSplit=(href) ? href.split('#'):'';
var hrefPage=linkSplit[0] ? linkSplit[0]:'';
if(anchor.length){
if(hrefPage===currentPage||hrefPage==='') evt.preventDefault();
MK.HB.utils.scrollToAnchor(anchor);
}else if($this.attr('href')==='#'){
evt.preventDefault();
}}
var width=Math.max(document.documentElement.clientWidth, window.innerWidth||0);
$('.menu-item-has-children.mkhb-no-mega-menu').hover(function(){
var offset=$(this).offset();
var this_sub_menu_box=$(this).find('.sub-menu');
var sub_menu_width=this_sub_menu_box.width();
if(offset.hasOwnProperty('left')&&(offset.left + sub_menu_width) > width){
this_sub_menu_box.css({ 'left': 'auto', 'right': 0 });
}});
}(jQuery));
(function($){
'use strict';
var _toBuild=[];
MK.api=window.MK.api||{};
MK.component.AdvancedGMaps=function(el){
var $this=$(el),
container=document.getElementById('mk-theme-container'),
data=$this.data('advancedgmaps-config'),
apikey=data.options.apikey ? ('key='+data.options.apikey+'&'):false,
map=null,
bounds=null,
infoWindow=null,
position=null;
var build=function(){
data.options.scrollwheel=false;
data.options.mapTypeId=google.maps.MapTypeId[data.options.mapTypeId];
data.options.styles=data.style;
bounds=new google.maps.LatLngBounds();
map=new google.maps.Map(el, data.options);
infoWindow=new google.maps.InfoWindow();
map.setOptions({
panControl:data.options.panControl,
draggable: data.options.draggable,
zoomControl: data.options.zoomControl,
mapTypeControl: data.options.scaleControl,
scaleControl: data.options.mapTypeControl,
});
var marker, i;
map.setTilt(45);
for (i=0; i < data.places.length; i++){
if(data.places[i].latitude&&data.places[i].longitude){
position=new google.maps.LatLng(data.places[i].latitude, data.places[i].longitude);
bounds.extend(position);
marker=new google.maps.Marker({
position: position,
map: map,
title: data.places[i].address,
icon: (data.places[i].marker) ? data.places[i].marker:data.icon
});
google.maps.event.addListener(marker, 'click', (function(marker, i){
return function(){
if(data.places[i].address&&data.places[i].address.length > 1){
infoWindow.setContent(''+ data.places[i].address +'
');
infoWindow.open(map, marker);
}else{
infoWindow.setContent('');
infoWindow.close();
}};})(marker, i));
if(i > 0){
map.fitBounds(bounds);
}else{
var latLang={
lat: parseFloat(data.places[i].latitude),
lng: parseFloat(data.places[i].longitude)
};
map.setCenter(latLang);
map.setZoom(data.options.zoom);
}}
}
var boundsListener=google.maps.event.addListener((map), 'bounds_changed', function(event){
this.setZoom(data.options.zoom);
google.maps.event.removeListener(boundsListener);
});
var update=function(){
google.maps.event.trigger(map, "resize");
map.setCenter(position);
};
update();
var bindEvents=function(){
$(window).on('resize', update);
window.addResizeListener(container, update);
};
bindEvents();
};
var initAll=function(){
for(var i=0, l=_toBuild.length; i < l; i++){
_toBuild[i]();
}};
MK.api.advancedgmaps=MK.api.advancedgmaps||function(){
initAll();
};
return {
init:function(){
_toBuild.push(build);
MK.core.loadDependencies(['https://maps.googleapis.com/maps/api/js?'+apikey+'callback=MK.api.advancedgmaps']);
}};};
})(jQuery);
(function($){
'use strict';
function mk_animated_cols(){
function equalheight (container){
var currentTallest=0,
currentRowStart=0,
rowDivs=new Array(),
$el,
topPosition=0;
$(container).each(function(){
$el=$(this);
$($el).height('auto');
topPosition=$el.position().top;
if(currentRowStart!=topPosition){
for (var currentDiv=0 ; currentDiv < rowDivs.length ; currentDiv++){
rowDivs[currentDiv].height(currentTallest);
}
rowDivs.length=0;
currentRowStart=topPosition;
currentTallest=$el.height();
rowDivs.push($el);
}else{
rowDivs.push($el);
currentTallest=(currentTallest < $el.height()) ? ($el.height()):(currentTallest);
}
for (currentDiv=0 ; currentDiv < rowDivs.length ; currentDiv++){
rowDivs[currentDiv].height(currentTallest);
}});
return currentTallest;
}
function prepareCols(el){
var $this=el.parent().parent().find('.mk-animated-columns');
var iconHeight=equalheight('.vc_row .animated-column-icon, .animated-column-holder .mk-svg-icon'),
titleHeight=equalheight('.vc_row .animated-column-title'),
descHeight=equalheight('.vc_row .animated-column-desc'),
btnHeight=$this.find('.animated-column-btn').innerHeight();
if($this.hasClass('full-style')){
$this.find('.animated-column-item').each(function(){
var $this=$(this),
contentHeight=(iconHeight + 30) + (titleHeight + 10) + (descHeight + 70) + 34;
var $columnHeight=contentHeight * 1.5 + 50;
var $minHeight=parseInt($this.css('min-height'), 10);
if(! isNaN($minHeight)){
if($minHeight < $columnHeight){
$columnHeight=$minHeight;
}}
$this.height($columnHeight);
var $box_height=$this.outerHeight(true),
$icon_height=$this.find('.animated-column-icon, .animated-column-holder .mk-svg-icon').height();
$this.find('.animated-column-holder').css({
'paddingTop': $box_height / 2 - $icon_height
});
$this.animate({opacity:1}, 300);
});
}else{
$this.find('.animated-column-item').each(function(){
var $this=$(this),
halfHeight=$this.height() / 2,
halfIconHeight=$this.find('.animated-column-icon, .animated-column-holder .mk-svg-icon').height()/2,
halfTitleHeight=$this.find('.animated-column-simple-title').height()/2;
$this.find('.animated-column-holder').css({
'paddingTop': halfHeight - halfIconHeight
});
$this.find('.animated-column-title').css({
'paddingTop': halfHeight - halfTitleHeight
});
$this.animate({
opacity:1
}, 300);
});
}}
$('.mk-animated-columns').each(function(){
var that=this;
MK.core.loadDependencies([ MK.core.path.plugins + 'tweenmax.js' ], function(){
var $this=$(that),
$parent=$this.parent().parent(),
$columns=$parent.find('.column_container'),
index=$columns.index($this.parent());
if($this.hasClass('full-style')){
$this.find('.animated-column-item').hover(function(){
TweenLite.to($(this).find(".animated-column-holder"), 0.5, {
top: '-15%',
ease: Back.easeOut
});
TweenLite.to($(this).find(".animated-column-desc"), 0.5, {
top: '50%',
ease: Expo.easeOut
}, 0.4);
TweenLite.to($(this).find(".animated-column-btn"), 0.3, {
top: '50%',
ease: Expo.easeOut
}, 0.6);
},
function(){
TweenLite.to($(this).find(".animated-column-holder"), 0.5, {
top: '0%',
ease: Back.easeOut, easeParams:[3]
});
TweenLite.to($(this).find(".animated-column-desc"), 0.5, {
top: '100%',
ease: Back.easeOut
}, 0.4);
TweenLite.to($(this).find(".animated-column-btn"), 0.5, {
top: '100%',
ease: Back.easeOut
}, 0.2);
});
}
if($this.hasClass('simple-style')){
$this.find('.animated-column-item').hover(function(){
TweenLite.to($(this).find(".animated-column-holder"), 0.7, {
top: '100%',
ease: Expo.easeOut
});
TweenLite.to($(this).find(".animated-column-title"), 0.7, {
top: '0%',
ease: Back.easeOut
}, 0.2);
},
function(){
TweenLite.to($(this).find(".animated-column-holder"), 0.7, {
top: '0%',
ease: Expo.easeOut
});
TweenLite.to($(this).find(".animated-column-title"), 0.7, {
top: '-100%',
ease: Back.easeOut
}, 0.2);
});
}
if($columns.length===index + 1){
prepareCols($this);
$(window).on("resize", function(){
setTimeout(prepareCols($this), 1000);
});
}
MK.utils.eventManager.subscribe('iconsInsert', function(){
prepareCols($this);
});
});
});
}
$(window).on('load vc_reload', mk_animated_cols);
}(jQuery));
(function($){
'use strict';
var core=MK.core,
path=MK.core.path;
MK.component.BannerBuilder=function(el){
var init=function(){
var $this=$(el),
data=$this.data('bannerbuilder-config');
MK.core.loadDependencies([ MK.core.path.plugins + 'jquery.flexslider.js' ], function(){
$this.flexslider({
selector: '.mk-banner-slides > .mk-banner-slide',
animation: data.animation,
smoothHeight: false,
direction:'horizontal',
slideshow: true,
slideshowSpeed: data.slideshowSpeed,
animationSpeed: data.animationSpeed,
pauseOnHover: true,
directionNav: data.directionNav,
controlNav: false,
initDelay: 2000,
prevText: '',
nextText: '',
pauseText: '',
playText: ''
});
});
};
return {
init:init
};};
})(jQuery);
(function($){
'use strict';
var zIndex=0;
$('.mk-newspaper-wrapper').on('click', '.blog-loop-comments', function (event){
event.preventDefault();
var $this=$(event.currentTarget);
var $parent=$this.parents('.mk-blog-newspaper-item');
$parent.css('z-index', ++zIndex);
$this.parents('.newspaper-item-footer').find('.newspaper-social-share').slideUp(200).end().find('.newspaper-comments-list').slideDown(200);
setTimeout(function(){
MK.utils.eventManager.publish('item-expanded');
}, 300);
});
$('.mk-newspaper-wrapper').on('click', '.newspaper-item-share', function (event){
event.preventDefault();
var $this=$(event.currentTarget);
var $parent=$this.parents('.mk-blog-newspaper-item');
$parent.css('z-index', ++zIndex);
$this.parents('.newspaper-item-footer').find('.newspaper-comments-list').slideUp(200).end().find('.newspaper-social-share').slideDown(200);
setTimeout(function(){
MK.utils.eventManager.publish('item-expanded');
}, 300);
});
var init=function init(){
setTimeout(function(){
var $blog=$('.mk-blog-container');
var $imgs=$blog.find('img[data-mk-image-src-set]');
if($blog.hasClass('mk-blog-container-lazyload')&&$imgs.length){
$(window).on('scroll.mk_blog_lazyload', MK.utils.throttle(500, function(){
$imgs.each(function(index, elem){
if(MK.utils.isElementInViewport(elem)){
MK.component.ResponsiveImageSetter.init($(elem));
$imgs=$imgs.not($(elem));
}});
}));
$(window).trigger('scroll.mk_blog_lazyload');
$(window).trigger('resize')
MK.component.ResponsiveImageSetter.onResize($imgs);
}else{
MK.component.ResponsiveImageSetter.init($imgs);
MK.component.ResponsiveImageSetter.onResize($imgs);
}}, 50);
if($('body').hasClass('vc_editor')){
setTimeout(function(){
$(window).trigger('resize');
}, 2000)
}}
init();
$(window).on('vc_reload mk-image-loaded', init);
}(jQuery));
(function($){
'use strict';
var core=MK.core,
path=MK.core.path;
MK.component.Category=function(el){
var init=function(){
core.loadDependencies([ path.plugins + 'pixastic.js' ], function(){
blurImage($('.blur-image-effect .mk-loop-item .item-holder '));
});
core.loadDependencies([ path.plugins + 'minigrid.js' ], masonry);
};
var blurImage=function($item){
return $item.each(function(){
var $_this=$(this);
var img=$_this.find('.item-thumbnail');
img.clone().addClass("blur-effect item-blur-thumbnail").removeClass('item-thumbnail').prependTo(this);
var blur_this=$(".blur-effect", this);
blur_this.each(function(index, element){
if(img[index].complete===true){
Pixastic.process(blur_this[index], "blurfast", {amount:0.5});
}else{
blur_this.load(function (){
Pixastic.process(blur_this[index], "blurfast", {amount:0.5});
});
}});
});
};
var masonry=function(){
if(!$('.js-masonry').length) return;
function grid(){
minigrid({
container: '.js-masonry',
item: '.js-masonry-item',
gutter: 0
});
}
grid();
$(window).on('resize', grid);
};
return {
init:init
};};
})(jQuery);
(function($){
'use strict';
var core=MK.core,
path=core.path;
MK.component.Chart=function(el){
var init=function(){
MK.core.loadDependencies([MK.core.path.plugins + 'jquery.easyPieChart.js'], function(){
$('.mk-chart__chart').each(function(){
var $this=$(this),
$parent_width=$(this).parent().width(),
$chart_size=parseInt($this.attr('data-barSize'));
if($parent_width < $chart_size){
$chart_size=$parent_width;
$this.css('line-height', $chart_size);
$this.find('i').css({
'line-height': $chart_size + 'px'
});
$this.css({
'line-height': $chart_size + 'px'
});
}
var build=function(){
$this.easyPieChart({
animate: 1300,
lineCap: 'butt',
lineWidth: $this.attr('data-lineWidth'),
size: $chart_size,
barColor: $this.attr('data-barColor'),
trackColor: $this.attr('data-trackColor'),
scaleColor: 'transparent',
onStep: function(value){
this.$el.find('.chart-percent span').text(Math.ceil(value));
}});
};
MK.utils.scrollSpy(this, {
position: 'bottom',
after: build
});
});
});
};
return {
init: init
};};
})(jQuery);
(function($){
"use strict";
$('.mk-clients.column-style').each(function(){
var $group=$(this),
$listItems=$group.find('li'),
listItemsCount=$listItems.length,
listStyle=$group.find('ul').attr('style')||'',
fullRowColumnsCount=$group.find('ul:first-of-type li').length;
function recreateGrid(){
var i;
$listItems.unwrap();
if(window.matchMedia('(max-width: 550px)').matches&&fullRowColumnsCount >=1){
for (i=0; i < listItemsCount; i +=1){
$listItems.slice(i, i + 1)
.wrapAll('');
}}else if(window.matchMedia('(max-width: 767px)').matches&&fullRowColumnsCount >=2){
for (i=0; i < listItemsCount; i +=2){
$listItems.slice(i, i + 2)
.wrapAll('');
}}else if(window.matchMedia('(max-width: 960px)').matches&&fullRowColumnsCount >=3){
for (i=0; i < listItemsCount; i +=3){
$listItems.slice(i, i + 3)
.wrapAll('');
}}else{
for (i=0; i < listItemsCount; i +=fullRowColumnsCount){
$listItems.slice(i, i + fullRowColumnsCount)
.wrapAll('');
}}
}
recreateGrid();
$(window).on('resize', recreateGrid);
});
}(jQuery));
(function($){
'use strict';
$(window).on('vc_reload', function(){
$('.mk-event-countdown-ul').each(function(){
if($(this).width() < 750){
$(this).addClass('mk-event-countdown-ul-block');
}else{
$(this).removeClass('mk-event-countdown-ul-block');
}});
});
})(jQuery);
(function($){
'use strict';
$('.mk-edge-slider').find('video').each(function(){
this.pause();
this.currentTime=0;
});
MK.component.EdgeSlider=function(el){
var self=this,
$this=$(el),
$window=$(window),
$wrapper=$this.parent(),
config=$this.data('edgeslider-config'),
$nav=$(config.nav),
$prev=$nav.find('.mk-edge-prev'),
$prevTitle=$prev.find('.nav-item-caption'),
$prevBg=$prev.find('.edge-nav-bg'),
$next=$nav.find('.mk-edge-next'),
$nextTitle=$next.find('.nav-item-caption'),
$nextBg=$next.find('.edge-nav-bg'),
$navBtns=$nav.find('a'),
$pagination=$('.swiper-pagination'),
$skipBtn=$('.edge-skip-slider'),
$opacityLayer=$this.find('.edge-slide-content'),
$videos=$this.find('video'),
currentSkin=null,
currentPoint=null,
winH=null,
opacity=null,
offset=null;
var callbacks={
onInitialize:function(slides){
self.$slides=$(slides);
self.slideContents=$.map(self.$slides, function(slide){
var $slide=$(slide),
title=$slide.find('.edge-slide-content .edge-title').first().text(),
skin=$slide.attr("data-header-skin"),
image=$slide.find('.mk-section-image').attr('data-thumb') ||
$slide.find('.mk-video-section-touch').attr('data-thumb'),
bgColor=$slide.find('.mk-section-image').css('background-color');
return {
skin: skin,
title: title,
image: image,
bgColor: bgColor
};});
if(MK.utils.isSmoothScroll) $this.css('position', 'fixed');
setNavigationContent(1, self.$slides.length - 1);
setSkin(0);
playVideo(0);
setTimeout(function(){
$('.edge-slider-loading').fadeOut('100');
}, 1000);
},
onBeforeSlide:function(id){
},
onAfterSlide:function(id){
setNavigationContent(nextFrom(id), prevFrom(id));
setSkin(id);
stopVideos();
playVideo(id);
}};
var nextFrom=function nextFrom(id){
return(id + 1===self.$slides.length) ? 0:id + 1;
};
var prevFrom=function prevFrom(id){
return(id - 1===-1) ? self.$slides.length - 1:id - 1;
};
var setNavigationContent=function(nextId, prevId){
if(self.slideContents[ prevId ]){
$prevTitle.text(self.slideContents[ prevId ].title);
$prevBg.css('background',
self.slideContents[ prevId ].image!=='none' ?
'url(' + self.slideContents[ prevId ].image + ')' :
self.slideContents[ prevId ].bgColor);
}
if(self.slideContents[ nextId ]){
$nextTitle.text(self.slideContents[ nextId ].title);
$nextBg.css('background',
self.slideContents[ nextId ].image!=='none' ?
'url(' + self.slideContents[ nextId ].image + ')' :
self.slideContents[ nextId ].bgColor);
}};
var setSkin=function setSkin(id){
currentSkin=self.slideContents[ id ].skin;
$navBtns.attr('data-skin', currentSkin);
$pagination.attr('data-skin', currentSkin);
$skipBtn.attr('data-skin', currentSkin);
if(self.config.firstEl){
MK.utils.eventManager.publish('firstElSkinChange', currentSkin);
}};
var stopVideos=function stopVideos(){
$videos.each(function(){
this.pause();
this.currentTime=0;
});
};
var playVideo=function playVideo(id){
var video=self.$slides.eq(id).find('video').get(0);
if(video){
video.play();
console.log('play video in slide nr ' + id);
}};
var onResize=function onResize(){
var height=$wrapper.height();
$this.height(height);
var width=$wrapper.width();
$this.width(width);
winH=$window.height();
offset=$this.offset().top;
if(!MK.utils.isSmoothScroll) return;
if(MK.utils.isResponsiveMenuState()){
$this.css({
'-webkit-transform': 'translateZ(0)',
'-moz-transform': 'translateZ(0)',
'-ms-transform': 'translateZ(0)',
'-o-transform': 'translateZ(0)',
'transform': 'translateZ(0)',
'position': 'absolute'
});
$opacityLayer.css({
'opacity': 1
});
}else{
onScroll();
}};
var onScroll=function onScroll(){
currentPoint=- MK.val.scroll();
if(offset + currentPoint <=0){
opacity=1 + ((offset + currentPoint) / winH) * 2;
opacity=Math.min(opacity, 1);
opacity=Math.max(opacity, 0);
$opacityLayer.css({
opacity: opacity
});
}
$this.css({
'-webkit-transform': 'translateY(' + currentPoint + 'px) translateZ(0)',
'-moz-transform': 'translateY(' + currentPoint + 'px) translateZ(0)',
'-ms-transform': 'translateY(' + currentPoint + 'px) translateZ(0)',
'-o-transform': 'translateY(' + currentPoint + 'px) translateZ(0)',
'transform': 'translateY(' + currentPoint + 'px) translateZ(0)',
'position': 'fixed'
});
};
onResize();
$window.on('load', onResize);
$window.on('resize', onResize);
window.addResizeListener($wrapper.get(0), onResize);
if(MK.utils.isSmoothScroll){
onScroll();
$window.on('scroll', function(){
if(MK.utils.isResponsiveMenuState()) return;
window.requestAnimationFrame(onScroll);
});
}
this.el=el;
this.config=$.extend(config, callbacks);
this.slideContents=null;
this.config.edgeSlider=true;
};
MK.component.EdgeSlider.prototype={
init:function(){
var slider=new MK.ui.Slider(this.el, this.config);
slider.init();
}};})(jQuery);
(function ($){
'use strict';
var init=function init(){
$('.mk-faq-wrapper').each(function(){
var $this=$(this);
var $filter=$this.find('.filter-faq');
var $filterItem=$filter.find('a');
var $faq=$this.find('.mk-faq-container > div');
var currentFilter='';
$filterItem.on('click', function(e){
var $this=$(this);
currentFilter=$this.data('filter');
$filterItem.removeClass('current');
$this.addClass('current');
filterItems(currentFilter);
e.preventDefault();
});
function filterItems(cat){
if(cat===''){
$faq.slideDown(200).removeClass('hidden');
return;
}
$faq.not('.' + cat).slideUp(200).addClass('hidden');
$faq.filter('.' + cat).slideDown(200).removeClass('hidden');
}});
}
init();
$(window).on('vc_reload', init);
}(jQuery));
(function ($){
'use strict';
function mk_flickr_feeds(){
$('.mk-flickr-feeds').each(function(){
var $this=$(this),
apiKey=$this.attr('data-key'),
userId=$this.attr('data-userid'),
perPage=$this.attr('data-count'),
column=$this.attr('data-column');
if(! $('.mk-flickr-feeds').is(':empty')){
return;
}
jQuery.getJSON('https://api.flickr.com/services/rest/?format=json&method=' + 'flickr.photos.search&api_key=' + apiKey + '&user_id=' + userId + '&&per_page=' + perPage + '&jsoncallback=?', function(data){
jQuery.each(data.photos.photo, function(i, rPhoto){
var basePhotoURL='http://farm' + rPhoto.farm + '.static.flickr.com/' + rPhoto.server + '/' + rPhoto.id + '_' + rPhoto.secret;
var thumbPhotoURL=basePhotoURL + '_q.jpg';
var mediumPhotoURL=basePhotoURL + '.jpg';
var photoStringStart=' ;';
var photoString=(i < perPage) ? photoStringStart + photoStringEnd:photoStringStart + photoStringEnd;
jQuery(photoString).appendTo($this);
});
});
});
}
mk_flickr_feeds();
$(window).on('vc_reload', mk_flickr_feeds);
})(jQuery);
jQuery(function($){
'use strict';
var init=function init(){
var $gallery=$('.mk-gallery');
var $imgs=$gallery.find('img[data-mk-image-src-set]');
if($gallery.hasClass('mk-gallery-lazyload')&&$imgs.length){
$(window).on('scroll.mk_gallery_lazyload', MK.utils.throttle(500, function(){
$imgs.each(function(index, elem){
if(MK.utils.isElementInViewport(elem)){
MK.component.ResponsiveImageSetter.init($(elem));
$imgs=$imgs.not($(elem));
}});
}));
$(window).trigger('scroll.mk_gallery_lazyload');
MK.component.ResponsiveImageSetter.onResize($imgs);
}else{
MK.component.ResponsiveImageSetter.init($imgs);
MK.component.ResponsiveImageSetter.onResize($imgs);
}}
init();
$(window).on('vc_reload mk-image-loaded', init);
});
(function($){
'use strict';
function mk_section_intro_effects(){
if(!MK.utils.isMobile()){
if(!$.exists('.mk-page-section.intro-true')) return;
$('.mk-page-section.intro-true').each(function(){
var that=this;
MK.core.loadDependencies([ MK.core.path.plugins + 'jquery.sectiontrans.js', MK.core.path.plugins + 'tweenmax.js' ], function(){
var $this=$(that),
$pageCnt=$this.parent().nextAll('div'),
windowHeight=$(window).height(),
effectName=$this.attr('data-intro-effect'),
$header=$('.mk-header');
var effect={
fade: new TimelineLite({paused: true})
.set($pageCnt, { opacity: 0, y: windowHeight * 0.3 })
.to($this, 1, { opacity: 0, ease:Power2.easeInOut })
.to($pageCnt, 1, { opacity: 1, y: 0, ease:Power2.easeInOut}, "-=.7")
.set($this, { zIndex: '-1'}),
zoom_out: new TimelineLite({paused: true})
.set($pageCnt, { opacity: 0, y: windowHeight * 0.3})
.to($this, 1.5, { opacity: .8, scale: 0.8, y: -windowHeight - 100, ease:Strong.easeInOut })
.to($pageCnt, 1.5, { opacity: 1, y: 0, ease:Strong.easeInOut}, "-=1.3"),
shuffle: new TimelineLite({paused: true})
.to($this, 1.5, { y: -windowHeight/2, ease:Strong.easeInOut })
.to($pageCnt.first(), 1.5, { paddingTop: windowHeight/2, ease:Strong.easeInOut }, "-=1.3")
};
console.log($pageCnt);
$this.sectiontrans({
effect: effectName
});
if($this.hasClass('shuffled')){
TweenLite.set($this, { y: -windowHeight/2 });
TweenLite.set($this.nextAll('div').first(), { paddingTop: windowHeight/2 });
}
$('body').on('page_intro', function(){
MK.utils.scroll.disable();
$(this).data('intro', true);
effect[effectName].play();
setTimeout(function(){
$header.addClass('pre-sticky');
$header.addClass('a-sticky');
$('.mk-header-padding-wrapper').addClass('enable-padding');
$('body').data('intro', false);
if(effectName==='shuffle') $this.addClass('shuffled');
}, 1000);
setTimeout(MK.utils.scroll.enable, 1500);
});
$('body').on('page_outro', function(){
MK.utils.scroll.disable();
$(this).data('intro', true);
effect[effectName].reverse();
setTimeout(function(){
$header.removeClass('pre-sticky');
$header.removeClass('a-sticky');
$('.mk-header-padding-wrapper').removeClass('enable-padding');
$('body').data('intro', false);
if($this.hasClass('shuffled')) $this.removeClass('shuffled');
}, 1000);
setTimeout(MK.utils.scroll.enable, 1500);
});
});
});
}else{
$('.mk-page-section.intro-true').each(function(){
$(this).attr('data-intro-effect', '');
});
}}
mk_section_intro_effects();
var debounceResize=null;
$(window).on("resize", function(){
if(debounceResize!==null){ clearTimeout(debounceResize); }
debounceResize=setTimeout(mk_section_intro_effects, 300);
});
function mk_section_adaptive_height(){
$(".mk-page-section.mk-adaptive-height").each(function(){
var imageHeight=$(this).find(".mk-adaptive-image").height();
$(this).css("height", imageHeight);
});
}
$(window).on("load resize", mk_section_adaptive_height);
var init=function init(){
var $allLayers=$('.mk-page-section .background-layer').filter(function(index){
var isLazyLoad=$(this).attr('data-mk-lazyload')==='true';
if(!isLazyLoad){
MK.component.BackgroundImageSetter.init($(this));
}
return isLazyLoad;
});;
if($allLayers.length){
$(window).on('scroll.mk_page_section_lazyload', MK.utils.throttle(500, function(){
$allLayers.each(function(index, elem){
if(MK.utils.isElementInViewport(elem)){
MK.component.BackgroundImageSetter.init($(elem));
$allLayers=$allLayers.not($(elem));
}});
}));
$(window).trigger('scroll.mk_page_section_lazyload');
MK.component.BackgroundImageSetter.onResize($allLayers);
}}
init();
$(window).on('vc_reload', init);
function mk_section_half_layout(){
$(".mk-page-section.half_boxed").each(function(){
var $section=$(this);
if($(window).width() > jupiterDonutVars.gridWidth){
var margin=($(window).width() - jupiterDonutVars.gridWidth) / 2;
var $section_inner=$section.find('.mk-half-layout-inner');
if($section.hasClass('half_left_layout')){
$section_inner.css({
marginRight: margin + 'px'
});
}
if($section.hasClass('half_right_layout')){
$section_inner.css({
marginLeft: margin + 'px'
});
}}
});
}
$(window).on("load resize", mk_section_half_layout);
function mk_reset_section_fluid_width_equal_height_columns(){
var $colWrappers='', maxWidth=850;
$colWrappers=$('.page-section-content.fluid-width-equal-height-columns');
$colWrappers.each(function(){
var $colWrapper='', colHeight=0;
$colWrapper=$(this);
$colWrapper.find('.wpb_column.column_container').each(function(){
var $col=$(this), size=$(this).children('div').length;
if(size > 0){
$col.removeAttr("style");
$col.children('div').each(function(){
var $this=$(this);
if(! $this.hasClass('mk-advanced-gmaps')){
$this.removeAttr('style');
}});
}});
});
}
function mk_section_fluid_width_equal_height_columns(){
mk_reset_section_fluid_width_equal_height_columns();
var $colWrappers='', maxWidth=850, $pageSection=$('.page-section-content');
if(! $pageSection.hasClass('.fluid-width-equal-height-columns')){
$pageSection.find('.wpb_column.column_container').removeAttr('style');
$pageSection.find('.wpb_column.column_container .vc_element').removeAttr('style');
}
$colWrappers=$('.page-section-content.fluid-width-equal-height-columns');
$colWrappers.each(function(){
var $colWrapper='', colHeight=0;
$colWrapper=$(this);
if($colWrapper.length > 0){
colHeight=$colWrappers.outerHeight(true);
$colWrapper.find('.wpb_column.column_container').each(function(){
var $col=$(this);
if($col.length > 0){
colHeight=($col.outerHeight(true) > colHeight) ? $col.outerHeight(true):colHeight;
}});
}
if(colHeight > 0){
$colWrapper.find('.wpb_column.column_container').each(function(){
var $col=$(this), size=$(this).children('div').length;
if(size > 0){
colHeight=($(window).width() < maxWidth) ? 'initial':colHeight;
$col.css("height", colHeight);
if($colWrapper.hasClass('vertical-align-center')){
$col.children('div').each(function(){
var elHeight=($(window).width() < maxWidth) ? 'initial':(colHeight/size);
if(! $(this).hasClass('mk-advanced-gmaps')){
$(this).css("height", elHeight);
}});
}}
});
}});
}
$(window).on('load vc_reload', function(){
setTimeout(function(){
mk_section_fluid_width_equal_height_columns();
}, 500);
});
var debounceResize=null;
$(window).on("resize", function(){
if(debounceResize!==null){ clearTimeout(debounceResize); }
debounceResize=setTimeout(mk_section_fluid_width_equal_height_columns(), 500);
});
}(jQuery));
(function($){
'use strict';
function mk_page_title_parallax(){
if(!MK.utils.isMobile()){
$('.mk-effect-wrapper').each(function(){
var $this=$(this),
progressVal,
currentPoint,
ticking=false,
scrollY=MK.val.scroll(),
$window=$(window),
windowHeight=$(window).height(),
parentHeight=$this.outerHeight(),
startPoint=0,
endPoint=$this.offset().top + parentHeight,
effectLayer=$this.find('.mk-effect-bg-layer'),
gradientLayer=effectLayer.find('.mk-effect-gradient-layer'),
cntLayer=$this.find('.mk-page-title-box-content'),
animation=effectLayer.attr('data-effect'),
top=$this.offset().top,
height=$this.outerHeight();
var parallaxSpeed=0.7,
zoomFactor=1.3;
var parallaxTopGap=function(){
var gap=top * parallaxSpeed;
effectLayer.css({
height:height + gap + 'px',
top:(-gap) + 'px'
});
};
if(animation==("parallax"||"parallaxZoomOut")){
parallaxTopGap();
}
var animationSet=function(){
scrollY=MK.val.scroll();
if(animation=="parallax"){
currentPoint=(startPoint + scrollY) * parallaxSpeed;
effectLayer.get(0).style.transform='translateY(' + currentPoint + 'px)';
}
if(animation=="parallaxZoomOut"){
console.log(effectLayer);
currentPoint=(startPoint + scrollY) * parallaxSpeed;
progressVal=(1 / (endPoint - startPoint) * (scrollY - startPoint));
var zoomCalc=zoomFactor - ((zoomFactor - 1) * progressVal);
effectLayer.get(0).style.transform='translateY(' + currentPoint + 'px) scale(' + zoomCalc + ')';
}
if(animation=="gradient"){
progressVal=(1 / (endPoint - startPoint) * (scrollY - startPoint));
gradientLayer.css({
opacity: progressVal * 2
});
}
if(animation!="gradient"){
progressVal=(1 / (endPoint - startPoint) * (scrollY - startPoint));
cntLayer.css({
opacity: 1 - (progressVal * 4)
});
}
ticking=false;
};
animationSet();
var requestTick=function(){
if(!ticking){
window.requestAnimationFrame(animationSet);
ticking=true;
}};
$window.off('scroll', requestTick);
$window.on('scroll', requestTick);
});
}}
var $window=$(window);
var debounceResize=null;
$window.on('load', mk_page_title_parallax);
$window.on("resize", function(){
if(debounceResize!==null){ clearTimeout(debounceResize); }
debounceResize=setTimeout(mk_page_title_parallax, 300);
});
}(jQuery));
(function($){
'use strict';
var utils=MK.utils,
core=MK.core,
path=MK.core.path;
MK.component.PhotoAlbum=function(el){
this.album=el;
this.initialOpen=false;
};
MK.component.PhotoAlbum.prototype={
dom: {
gallery: '.slick-slider-wrapper',
title: '.slick-title',
galleryContainer: '.slick-slides',
closeBtn: '.slick-close-icon',
thumbList: '.slick-dots',
thumbs: '.slick-dots li',
imagesData: 'photoalbum-images',
titleData: 'photoalbum-title',
idData: 'photoalbum-id',
urlData: 'photoalbum-url',
activeClass: 'is-active'
},
tpl: {
gallery: '#tpl-photo-album',
slide: '
'
},
init: function(){
this.cacheElements();
this.bindEvents();
this.openByLink();
},
cacheElements: function(){
this.$album=$(this.album);
this.imagesSrc=this.$album.data(this.dom.imagesData);
this.albumLength=this.imagesSrc.length;
this.title=this.$album.data(this.dom.titleData);
this.id=this.$album.data(this.dom.idData);
this.url=this.$album.data(this.dom.urlData);
this.images=[];
},
bindEvents: function(){
this.$album.not('[data-photoalbum-images="[null]"]').on('click', this.albumClick.bind(this));
$(document).on('click', this.dom.closeBtn, this.closeClick.bind(this));
$(window).on('resize', this.thumbsVisibility.bind(this));
$(window).on('resize', this.makeArrows.bind(this));
},
albumClick: function(e){
e.preventDefault();
this.open();
MK.ui.loader.add(this.album);
},
closeClick: function(e){
e.preventDefault();
if(this.slider){
this.removeGallery();
this.slider.exitFullScreen();
}},
thumbsVisibility: function(){
if(!this.thumbsWidth) return;
if(window.matchMedia('(max-width:' + (this.thumbsWidth + 260) + 'px)').matches) this.hideThumbs();
else this.showThumbs();
},
hideThumbs: function(){
if(!this.$thumbList) return;
this.$thumbList.hide();
},
showThumbs: function(){
if(!this.$thumbList) return;
this.$thumbList.show();
},
open: function(){
var self=this;
core.loadDependencies([path.plugins + 'slick.js'], function(){
self.createGallery();
self.loadImages();
});
},
createGallery: function(){
if(!$(this.dom.gallery).length){
var tpl=$(this.tpl.gallery).eq(0).html();
$('body').append(tpl);
}
this.$gallery=$(this.dom.gallery);
this.$closeBtn=$(this.dom.closeBtn);
},
createSlideshow: function(){
var self=this;
this.slider=new MK.ui.FullScreenGallery(this.dom.galleryContainer, {
id: this.id,
url: this.url
});
this.slider.init();
$(window).trigger('resize');
this.makeArrows();
this.$thumbList=$(this.dom.thumbList);
this.$thumbs=$(this.dom.thumbs);
this.thumbsWidth=(this.$thumbs.length) * 95;
this.thumbsVisibility();
setTimeout(function(){
MK.ui.loader.remove(self.album);
}, 100);
MK.utils.eventManager.publish('photoAlbum-open');
},
makeArrows: function(){
if(this.arrowsTimeout) clearTimeout(this.arrowsTimeout);
this.arrowsTimeout=setTimeout(function(){
var $prev=$('.slick-prev').find('svg');
var $next=$('.slick-next').find('svg');
$prev.wrap('
');
$next.wrap('
');
if(matchMedia("(max-width: 1024px)").matches){
$prev.attr({
width: 12,
height: 22
}).find('polyline').attr('points', '12,0 0,11 12,22');
$next.attr({
width: 12,
height: 22
}).find('polyline').attr('points', '0,0 12,11 0,22');
}else{
$prev.attr({
width: 33,
height: 65
}).find('polyline').attr('points', '0.5,0.5 32.5,32.5 0.5,64.5');
$next.attr({
width: 33,
height: 65
}).find('polyline').attr('points', '0.5,0.5 32.5,32.5 0.5,64.5');
}}, 0);
},
loadImages: function(){
var self=this,
n=0;
if(!this.images.length){
this.imagesSrc.forEach(function(src){
if(src===null) return;
var img=new Image();
img.onload=function(){
self.onLoad(n +=1);
};
img.src=src;
self.images.push(img);
});
}else{
this.onLoad(this.albumLength);
}},
onLoad: function(n){
if(n===this.albumLength){
this.insertImages();
this.showGallery();
this.createSlideshow();
}},
insertImages: function(){
var $galleryContainer=this.$gallery.find(this.dom.galleryContainer),
$title=$(this.dom.title),
slide=this.tpl.slide;
$galleryContainer.html('');
$title.html(this.title);
this.images.forEach(function(img){
var $slide=$(slide);
$slide.html(img);
$galleryContainer.prepend($slide);
});
},
showGallery: function(){
var self=this;
this.$gallery.addClass(this.dom.activeClass);
utils.scroll.disable();
},
removeGallery: function(){
var self=this;
this.$gallery.removeClass(this.dom.activeClass);
setTimeout(function(){
self.$gallery.remove();
}, 300);
utils.scroll.enable();
},
openByLink: function(){
var loc=window.location,
hash=loc.hash,
id;
if(hash.length&&hash.substring(1).length){
id=hash.substring(1);
id=id.replace('!loading', '');
if(id==this.id&&!this.initialOpen){
this.initialOpen=true;
this.open();
}}
}};
MK.component.PhotoAlbumBlur=function(el){
var init=function(){
core.loadDependencies([path.plugins + 'pixastic.js'], function(){
blurImage($('.mk-album-item figure'));
});
};
var blurImage=function($item){
return $item.each(function(){
var $_this=$(this);
var img=$_this.find('.album-cover-image');
img.clone().addClass("blur-effect item-blur-thumbnail").removeClass('album-cover-image').prependTo(this);
var blur_this=$(".blur-effect", this);
blur_this.each(function(index, element){
if(img[index].complete===true){
Pixastic.process(blur_this[index], "blurfast", {
amount: 0.5
});
}else{
blur_this.load(function(){
Pixastic.process(blur_this[index], "blurfast", {
amount: 0.5
});
});
}});
});
};
return {
init: init
};};
})(jQuery);
jQuery(document).ready(function($){
if(typeof window.safari==='undefined'){
return;
}
function mkRedraw(){
$('.mk-photo-roller').hide().show(0);
}
mkRedraw();
$(window).resize(function(){
mkRedraw()
});
});
jQuery(function($){
'use strict';
var init=function init(){
var $portfolio=$('.portfolio-grid');
var $imgs=$portfolio.find('img[data-mk-image-src-set]');
if($portfolio.hasClass('portfolio-grid-lazyload')&&$imgs.length){
$(window).on('scroll.mk_portfolio_lazyload', MK.utils.throttle(500, function(){
$imgs.each(function(index, elem){
if(MK.utils.isElementInViewport(elem)){
MK.component.ResponsiveImageSetter.init($(elem));
$imgs=$imgs.not($(elem));
}});
}));
$(window).trigger('scroll.mk_portfolio_lazyload');
MK.component.ResponsiveImageSetter.onResize($imgs);
}else{
MK.component.ResponsiveImageSetter.init($imgs);
MK.component.ResponsiveImageSetter.onResize($imgs);
}}
init();
$(window).on('vc_reload mk-image-loaded', function(){
init();
$('.mk-portfolio-container').each(function(){
var id=$(this).attr('id');
var el='#' + id + '.mk-portfolio-container.js-el';
if($(this).data('mk-component')=='Grid'){
$(el).data('init-Grid', true);
var component=new MK.component[ 'Grid' ](el);
component.init();
}});
});
});
jQuery(document).ready(function($){
'use strict';
function get_item_width(style, showItems, id){
var item_width;
if(style=="classic"){
item_width=275;
items_to_show=4;
}else{
var screen_width=$('#portfolio-carousel-' + id).width(),
items_to_show=showItems;
if(screen_width >=1100){
item_width=screen_width / items_to_show;
}else if(screen_width <=1200&&screen_width >=800){
item_width=screen_width / 3;
}else if(screen_width <=800&&screen_width >=540){
item_width=screen_width / 2;
}else{
item_width=screen_width;
}}
return item_width;
}
jQuery(window).on("load vc_reload", function(){
MK.core.loadDependencies([MK.core.path.plugins + 'jquery.flexslider.js'], function(){
$('.portfolio-carousel .mk-flexslider').each(function(){
var $this=$(this);
var $pauseOnHover=$this.attr('data-pauseOnHover')=="true" ? true:false;
$this.flexslider({
selector: ".mk-flex-slides > li",
animation: "slide",
slideshowSpeed: parseInt($this.attr('data-slideshowSpeed')),
animationSpeed: parseInt($this.attr('data-animationSpeed')),
pauseOnHover: $pauseOnHover,
controlNav: false,
smoothHeight: false,
useCSS: false,
directionNav: $this.data('directionNav'),
prevText: "",
nextText: "",
itemWidth: get_item_width($this.data('style'), $this.data('showItems'), $this.data('id')),
itemMargin: 0,
maxItems: ($this.data('style')==='modern') ? $this.data('showItems'):4,
minItems: 1,
move: 1,
slideshow: false,
});
});
});
});
});
(function($){
if(window.addEventListener){
window.addEventListener('load', handleLoad, false);
}
else if(window.attachEvent){
window.attachEvent('onload', handleLoad);
}
function handleLoad(){
$('.mk-slideshow-box').each(run);
}
function run(){
var $slider=$(this);
var $slides=$slider.find('.mk-slideshow-box-item');
var $transition_time=$slider.data('transitionspeed');
var $time_between_slides=$slider.data('slideshowspeed');
$slider.find('.mk-slideshow-box-content').children('p').filter(function(){
if($.trim($(this).text())==''){
return true;
}}).remove();
$slides.first().addClass('active').fadeIn($transition_time, function(){
setTimeout(autoScroll, $time_between_slides);
});
function autoScroll(){
var $i=$slider.find('.active').index();
$slides.eq($i).removeClass('active').fadeOut($transition_time);
if($slides.length==$i + 1) $i=-1;
$slides.eq($i + 1).addClass('active').fadeIn($transition_time, function(){
setTimeout(autoScroll, $time_between_slides);
});
}
var browserName=MK.utils.browser.name;
if(browserName==='Firefox'||browserName==='Safari'){
var currentWidth=parseInt($(window).width());
if(currentWidth >=850){
var height=$slider.css('min-height');
if(typeof height!=='undefined'){
$slider.find('.mk-slideshow-box-items').height(parseInt(height));
}}else{
$slider.find('.mk-slideshow-box-items').removeAttr('style');
}}
}
$(window).on('vc_reload', function(){
handleLoad();
});
window.addEventListener('resize', function(){
var browserName=MK.utils.browser.name;
if(browserName==='Firefox'||browserName==='Safari'){
handleLoad();
}}, true);
}(jQuery));
(function($){
'use strict';
$(".mk-subscribe").each(function(){
var $this=$(this);
$this.find('.mk-subscribe--form').submit(function(e){
$this.addClass('form-in-progress');
e.preventDefault();
$.ajax({
url: MK.core.path.ajaxUrl,
type: "POST",
data: {
action: "mk_ajax_subscribe",
email: $this.find(".mk-subscribe--email").val(),
list_id: $this.find(".mk-subscribe--list-id").val(),
optin: $this.find(".mk-subscribe--optin").val()
},
success: function (response){
console.log(response)
$this.removeClass('form-in-progress');
var data=$.parseJSON(response),
$messaage_box=$this.find(".mk-subscribe--message");
$messaage_box.html(data.message);
if(data.action_status==true){
$messaage_box.addClass('success');
}else{
$messaage_box.addClass('error');
}
$this.find(".mk-subscribe--email").val('');
}});
});
});
}(jQuery));
(function($){
'use strict';
var _instancesCollection={};
var MK=window.MK||{};
window.MK=MK;
MK.component=window.MK.component||{};
MK.component.SwipeSlideshow=function(el){
var $this=$(el);
var id=$this.parent().attr('id');
this.el=el;
this.id=id;
this.config=$this.data('swipeslideshow-config');
if(this.config) this.config.hasPagination=false;
};
MK.component.SwipeSlideshow.prototype={
init:function(){
var slider=new MK.ui.Slider(this.el, this.config);
slider.init();
_instancesCollection[ this.id ]=slider;
}};
MK.component.SwipeSlideshowExtraNav=function(el){
this.el=el;
};
MK.component.SwipeSlideshowExtraNav.prototype={
init:function init(){
this.cacheElements();
this.bindEvents();
},
cacheElements:function cacheElements(){
var $this=$(this.el);
this.sliderId=$this.data('gallery');
this.slider=_instancesCollection[this.sliderId];
this.$thumbs=$('#' + this.sliderId).find('.thumbnails a');
},
bindEvents:function bindEvents(){
this.$thumbs.on('click', this.clickThumb.bind(this));
},
clickThumb:function clickThumb(e){
e.preventDefault();
var $this=$(e.currentTarget),
id=$this.index();
this.slider.goTo(id);
}};
MK.utils.eventManager.subscribe('gallery-update', function(e, config){
if(typeof _instancesCollection[config.id]==='undefined') return;
_instancesCollection[config.id].reset();
});
function init(){
var $swiper=$('.mk-swipe-slideshow');
var $imgs=$swiper.find('img[data-mk-image-src-set]');
if($swiper.hasClass('mk-swipe-slideshow-lazyload')&&$imgs.length){
$(window).on('scroll.mk_swipe_slideshow_lazyload', MK.utils.throttle(500, function(){
$imgs.each(function(index, elem){
if(MK.utils.isElementInViewport(elem)){
MK.component.ResponsiveImageSetter.init($(elem));
$imgs=$imgs.not($(elem));
}});
}));
$(window).trigger('scroll.mk_swipe_slideshow_lazyload');
MK.component.ResponsiveImageSetter.onResize($imgs);
}else{
MK.component.ResponsiveImageSetter.init($imgs);
MK.component.ResponsiveImageSetter.onResize($imgs);
}
/* Why we need to reinitialize it? it causes double sliding effect
$('.mk-swiper-container').each(function(){
new MK.component.SwipeSlideshow(this).init();
});
*/
}
init();
$(window).on('vc_reload mk-image-loaded', init);
})(jQuery);
(function($){
'use strict';
var core=MK.core,
path=core.path;
MK.component.Tooltip=function(el){
var init=function(){
$('.mk-tooltip').each(function(){
$(this).find('.mk-tooltip--link').hover(function(){
$(this).siblings('.mk-tooltip--text').stop(true).animate({
'opacity': 1
}, 400);
}, function(){
$(this).siblings('.mk-tooltip--text').stop(true).animate({
'opacity': 0
}, 400);
});
});
};
return {
init: init
};};
})(jQuery);
(function($){
'use strict';
function mkWcCarouselSwiperHeight(){
var mkWCRecentCarousel=$('.mk-woocommerce-carousel.classic-style');
mkWCRecentCarousel.each(function(){
var maxHeight=0;
var height=$(this).height();
var childs=$(this).find('.item');
childs.each(function(){
if($(this).height() > maxHeight){
maxHeight=$(this).height();
}});
var swiperContainers=$(this).find('.mk-swiper-container');
swiperContainers[0].style.setProperty('min-height', maxHeight + 'px', 'important');
});
}
mkWcCarouselSwiperHeight();
})(jQuery);
(function ($){
'use strict';
function dynamicHeight(){
var $this=$(this);
$this.height('auto');
if(window.matchMedia('(max-width: 768px)').matches){
return;
}
$this.height($this.height());
}
var $window=$(window);
var container=document.getElementById('mk-theme-container');
function equalColumns(){
$('.equal-columns').each(function(){
dynamicHeight.bind(this);
$window.on('load', dynamicHeight.bind(this));
$window.on('resize', dynamicHeight.bind(this));
$window.on('mk-image-loaded', dynamicHeight.bind(this));
window.addResizeListener(container, dynamicHeight.bind(this));
});
}
equalColumns();
$window.on('vc_reload' , function(){
equalColumns();
});
}(jQuery));
(function($){
'use strict';
function mk_video_play(){
var lightboxMargin=60;
function playSelfHosted($video, isLightbox){
if(isLightbox===undefined||typeof isLightbox==='undefined'){
isLightbox=false;
}
if(isLightbox){
var content=$video.parent().html();
playLightbox({
content: '' + $(content).attr('autoplay', 'autoplay').wrap('
').parent().html() + '
',
});
}else{
playTagVideo($video);
}}
function playSocialHosted($iframe, isLightbox){
if(isLightbox===undefined||typeof isLightbox==='undefined'){
isLightbox=false;
}
if(isLightbox){
playLightbox({
type: 'iframe',
href: $iframe.attr('src'),
helpers: {
media: true
}});
}else{
var videoData=getSocialVideoData($iframe.attr('src'));
switch (videoData.source){
case 'youtube':
playTagIframeYoutube(videoData.videoId, $iframe);
break;
case 'vimeo':
playTagIframeVimeo(videoData.videoId, $iframe);
break;
default:
playTagIframe($iframe);
break;
}}
}
function playLightbox(args){
var options={
padding: 0,
margin: lightboxMargin,
showCloseButton: 1,
autoSize: 0,
width: getVideoboxWidth(),
height: getVideoHeight(),
tpl: {
closeBtn: ' ',
},
};
$.extend(options, args);
$.fancybox.open(options);
}
function playTagVideo($video){
$video.get(0).play();
$video.closest('.video-container').find('.video-thumbnail').fadeOut('slow');
}
function playTagIframe($iframe, videoId){
var video_loop='';
if(videoId!==undefined&&typeof videoId!=='undefined'){
video_loop='&playlist=' + videoId;
}
var src=$iframe.attr('src');
var separator=(src.indexOf('?')===-1) ? '?':'&';
src +=separator + 'autoplay=1';
separator=(src.indexOf('?')===-1) ? '?':'&';
video_loop=separator + 'loop=1' + video_loop;
video_loop=($iframe.closest('.video-container').data('loop')=='1') ? video_loop:'';
src +=video_loop;
$iframe.attr('src', src).closest('.video-container').find('.video-thumbnail').fadeOut(3000);
}
function playTagIframeYoutube(videoId, $iframe){
if(document.getElementById('mk_iframe_api')===null){
var tag=document.createElement('script');
tag.src="https://www.youtube.com/iframe_api";
tag.id="mk_iframe_api";
var firstScriptTag=document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
}else{
runPlayer();
}
window.onYouTubeIframeAPIReady=function (){
runPlayer();
};
function runPlayer(){
var player,
isPlayed=false;
player=new YT.Player('video-player-' + $iframe.data('id'), {
videoId: videoId,
rel: false,
events: {
onReady: function(e){
e.target.playVideo();
},
onStateChange: function(e){
if(e.data===1&&!isPlayed){
$(e.target.a).closest('.video-container').find('.video-thumbnail').fadeOut('slow');
isPlayed=true;
}
if($(e.target.a).closest('.video-container').data('loop')&&e.data===YT.PlayerState.ENDED){
e.target.playVideo();
}},
onError: function(e){
playTagIframe($iframe, videoId);
}}
});
}}
function playTagIframeVimeo(videoId, $iframe){
$.getScript('//player.vimeo.com/api/player.js', function(data, textStatus, jqxhr){
if(jqxhr.status===200){
var player,
isPlayed=false;
player=new Vimeo.Player('video-player-' + $iframe.data('id'), {
id: videoId
});
player.play().then(function(){
if(!isPlayed){
$iframe.closest('.video-container').find('.video-thumbnail').fadeOut('slow');
isPlayed=true;
}}).catch(function(error){
playTagIframe($iframe);
});
if($iframe.closest('.video-container').data('loop')){
player.setLoop(true).then(function(loop){
}).catch(function(error){
playTagIframe($iframe);
});
}}else{
playTagIframe($iframe);
}});
}
function getSocialVideoData(url){
var youtubeRegex=/(youtube\.com|youtu\.be|youtube-nocookie\.com)\/(watch\?v=|v\/|u\/|embed\/?)?(videoseries\?list=(.*)|[\w-]{11}|\?listType=(.*)&list=(.*)).*/i;
var youtubeMatch=url.match(youtubeRegex);
if(youtubeMatch&&youtubeMatch!=null){
return {
source: 'youtube',
videoId: youtubeMatch[3]
};}
var vimeoRegex=/(?:vimeo(?:pro)?.com)\/(?:[^\d]+)?(\d+)(?:.*)/i;
var vimeoMatch=url.match(vimeoRegex);
if(vimeoMatch&&vimeoMatch!=null){
return {
source: 'vimeo',
videoId: vimeoMatch[1]
};}
return {
source: false,
videoId: false
};}
function getVideoboxWidth(){
var $width,
wWidth=$(window).width(),
wHeight=$(window).height();
if(wHeight >=wWidth){
$width=wWidth - (lightboxMargin * 2);
}else{
var wHeightMax=(wHeight * 90) / 100;
if(wWidth > 1280){
var $width=(wHeightMax / 5768) * 10000;
}else{
var $width=(wHeightMax / 6120) * 10000;
}}
return Math.round($width) + 'px';
}
function getVideoHeight(){
var $height,
wWidth=$(window).width(),
wHeight=$(window).height();
if(wHeight >=wWidth){
$height=((wWidth - (lightboxMargin * 2)) * 5670) / 10000;
}else{
$height=((wHeight * 90) / 100) + (lightboxMargin * 2);
}
return Math.round($height) + 'px';
}
$('.video-container').each(function(){
var $videoContainer=$(this);
var playSource=$videoContainer.data('source');
var playTarget=$videoContainer.data('target');
var $iframe=$videoContainer.find('iframe');
var $video=$videoContainer.find('video');
if($videoContainer.data('autoplay')){
switch (playSource){
case 'social_hosted':
playSocialHosted($iframe);
break;
case 'self_hosted':
playSelfHosted($video);
break;
}}else{
var $playIcon=$videoContainer.find('.mk-svg-icon');
$playIcon.bind('click', function(e){
e.preventDefault();
var isLightbox=(playTarget=='lightbox') ? true:false;
if(!isLightbox){
$playIcon.hide().next('.preloader-preview-area').show();
}
switch (playSource){
case 'social_hosted':
playSocialHosted($iframe, isLightbox);
break;
case 'self_hosted':
playSelfHosted($video, isLightbox);
break;
}});
}});
}
$(window).on('load vc_reload', mk_video_play);
function mk_video_resize_play_icon(){
$('.video-thumbnail-overlay').each(function(){
var $thumbnailOverlay=$(this);
var thumbnailWidth=$thumbnailOverlay.width();
var $svg=$thumbnailOverlay.find('svg');
if(typeof $svg.data('width')==='undefined'){
$svg.attr('data-width', $svg.width());
}
if(typeof $svg.data('height')==='undefined'){
$svg.attr('data-height', $svg.height());
}
if(($svg.data('width') * 4) > thumbnailWidth){
$svg.css({
width: Math.round((parseInt(thumbnailWidth) / 4)) + 'px',
height: Math.round((parseInt(thumbnailWidth) / 4) * $svg.data('height') / $svg.data('width')) + 'px'
});
}else{
$svg.css({
width: $svg.data('width') + 'px',
height: $svg.data('height') + 'px'
});
}});
}
$(window).on('load resize orientationChange vc_reload', mk_video_resize_play_icon);
}(jQuery));
!function(a,b){"use strict";function c(){if(!e){e=!0;var a,c,d,f,g=-1!==navigator.appVersion.indexOf("MSIE 10"),h=!!navigator.userAgent.match(/Trident.*rv:11\./),i=b.querySelectorAll("iframe.wp-embedded-content");for(c=0;c1e3)g=1e3;else if(~~g<200)g=200;f.height=g}if("link"===d.message)if(h=b.createElement("a"),i=b.createElement("a"),h.href=f.getAttribute("src"),i.href=d.value,i.host===h.host)if(b.activeElement===f)a.top.location.href=d.value}else;}},d)a.addEventListener("message",a.wp.receiveEmbedMessage,!1),b.addEventListener("DOMContentLoaded",c,!1),a.addEventListener("load",c,!1)}(window,document);
document.documentElement.className+=" js_active ",document.documentElement.className+="ontouchstart"in document.documentElement?" vc_mobile ":" vc_desktop ",function(){for(var prefix=["-webkit-","-moz-","-ms-","-o-",""],i=0;i=$tabs.tabs("length")&&(index=0),$tabs.tabs("select",index)):(index=$tabs.tabs("option","active"),length=$tabs.find(".wpb_tab").length,index=jQuery(this).parent().hasClass("wpb_next_slide")?length<=index+1?0:index+1:index-1<0?length-1:index-1,$tabs.tabs("option","active",index))})})}}),"function"!=typeof window.vc_accordionBehaviour&&(window.vc_accordionBehaviour=function(){jQuery(".wpb_accordion").each(function(index){var $tabs,active_tab,collapsible,$this=jQuery(this);$this.attr("data-interval"),collapsible=!1===(active_tab=!isNaN(jQuery(this).data("active-tab"))&&0 div > h3",autoHeight:!1,heightStyle:"content",active:active_tab,collapsible:collapsible,navigation:!0,activate:vc_accordionActivate,change:function(event,ui){void 0!==jQuery.fn.isotope&&ui.newContent.find(".isotope").isotope("layout"),vc_carouselBehaviour(ui.newPanel)}}),!0===$this.data("vcDisableKeydown")&&($tabs.data("uiAccordion")._keydown=function(){})})}),"function"!=typeof window.vc_teaserGrid&&(window.vc_teaserGrid=function(){var layout_modes={fitrows:"fitRows",masonry:"masonry"};jQuery(".wpb_grid .teaser_grid_container:not(.wpb_carousel), .wpb_filtered_grid .teaser_grid_container:not(.wpb_carousel)").each(function(){var $container=jQuery(this),$thumbs=$container.find(".wpb_thumbnails"),layout_mode=$thumbs.attr("data-layout-mode");$thumbs.isotope({itemSelector:".isotope-item",layoutMode:void 0===layout_modes[layout_mode]?"fitRows":layout_modes[layout_mode]}),$container.find(".categories_filter a").data("isotope",$thumbs).on("click",function(e){e&&e.preventDefault&&e.preventDefault();var $thumbs=jQuery(this).data("isotope");jQuery(this).parent().parent().find(".active").removeClass("active"),jQuery(this).parent().addClass("active"),$thumbs.isotope({filter:jQuery(this).attr("data-filter")})}),jQuery(window).bind("load resize",function(){$thumbs.isotope("layout")})})}),"function"!=typeof window.vc_carouselBehaviour&&(window.vc_carouselBehaviour=function($parent){($parent?$parent.find(".wpb_carousel"):jQuery(".wpb_carousel")).each(function(){var $this=jQuery(this);if(!0!==$this.data("carousel_enabled")&&$this.is(":visible")){$this.data("carousel_enabled",!0);getColumnsCount(jQuery(this));jQuery(this).hasClass("columns_count_1")&&900;var carousel_li=jQuery(this).find(".wpb_thumbnails-fluid li");carousel_li.css({"margin-right":carousel_li.css("margin-left"),"margin-left":0});var fluid_ul=jQuery(this).find("ul.wpb_thumbnails-fluid");fluid_ul.width(fluid_ul.width()+300),jQuery(window).on("resize",function(){screen_size!=(screen_size=getSizeName())&&window.setTimeout(function(){location.reload()},20)})}})}),"function"!=typeof window.vc_slidersBehaviour&&(window.vc_slidersBehaviour=function(){jQuery(".wpb_gallery_slides").each(function(index){var $imagesGrid,this_element=jQuery(this);if(this_element.hasClass("wpb_slider_nivo")){var sliderTimeout=1e3*this_element.attr("data-interval");0===sliderTimeout&&(sliderTimeout=9999999999),this_element.find(".nivoSlider").nivoSlider({effect:"boxRainGrow,boxRain,boxRainReverse,boxRainGrowReverse",slices:15,boxCols:8,boxRows:4,animSpeed:800,pauseTime:sliderTimeout,startSlide:0,directionNav:!0,directionNavHide:!0,controlNav:!0,keyboardNav:!1,pauseOnHover:!0,manualAdvance:!1,prevText:"Prev",nextText:"Next"})}else this_element.hasClass("wpb_image_grid")&&(jQuery.fn.imagesLoaded?$imagesGrid=this_element.find(".wpb_image_grid_ul").imagesLoaded(function(){$imagesGrid.isotope({itemSelector:".isotope-item",layoutMode:"fitRows"})}):this_element.find(".wpb_image_grid_ul").isotope({itemSelector:".isotope-item",layoutMode:"fitRows"}))})}),"function"!=typeof window.vc_prettyPhoto&&(window.vc_prettyPhoto=function(){try{jQuery&&jQuery.fn&&jQuery.fn.prettyPhoto&&jQuery('a.prettyphoto, .gallery-icon a[href*=".jpg"]').prettyPhoto({animationSpeed:"normal",hook:"data-rel",padding:15,opacity:.7,showTitle:!0,allowresize:!0,counter_separator_label:"/",hideflash:!1,deeplinking:!1,modal:!1,callback:function(){-1 ')}),vc_initVideoBackgrounds(),callSkrollInit=!1,window.vcParallaxSkroll&&window.vcParallaxSkroll.destroy(),$(".vc_parallax-inner").remove(),$("[data-5p-top-bottom]").removeAttr("data-5p-top-bottom data-30p-top-bottom"),$("[data-vc-parallax]").each(function(){var skrollrSize,skrollrStart,$parallaxElement,parallaxImage,youtubeId;callSkrollInit=!0,"on"===$(this).data("vcParallaxOFade")&&$(this).children().attr("data-5p-top-bottom","opacity:0;").attr("data-30p-top-bottom","opacity:1;"),skrollrSize=100*$(this).data("vcParallax"),($parallaxElement=$("